Hello
I’m making RSS reader and I’m using DOM.
Now I stuck, trying to reverse the order of the items in the DOMNodeList.
I can make it with 2 cycles – one to make it as array and one for rsort().
Is there any way to reverse the order in the DOMNodeList or must be done with “the array way”?
Hello I’m making RSS reader and I’m using DOM. Now I stuck, trying to
Share
There is no method for reversing a DOMNodeList.
But you can keep it as it is, and if you need it, walk through it from the end to the start.
Example:
Just point at the end of the NodeList using NodeList->length, then decrement the index and access NodeList->item(index)