I am trying to understand a small part of a code I am studying,
This is the Link to the code, the part i did not understand is this:
new RecursiveIteratorIterator($it, 1)
What I didn’t understand about this part is the second parameter, I tried to play with the value of this parameter and I assume it’s about the XML structure but the logic with it is a bit odd, So if anyone can please clarify to me about this second parameter?
Ok let me break it down
What you need to first understand is this line :
From PHP DOC
This means that all output would use
SimpleXMLIteratorand the best way to iterate is usingRecursiveIteratorIteratorRecursionis the process of repeating items in a self-similar way. See wikiExample
Output 1
Output 2