I hope I can explain my problem well enough! I would normally use a foreach loop but I need an alternative as each entry will be displayed on a separate web page. To add to my confusion it is not an array but a DOMNodeList that I am working with. What I would have if I were not displaying each entry on a separate page is:
Will the user be answering the same questions in the same order or will the questions they get asked depend on what their answers were to earlier questions?
While I’m not sure I understand why you’re accessing the DOM on the server side, if you know where you are in the array traversal (and you’re going to have to keep track of it somehow), you can just access the array directly.
In other words, use $items instead of the foreach loop. Or a range of numbers if you’re looking for more than one…