Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

simplexml load string question

order by

11:55 am on Jan 27, 2011 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 7, 2003
votes: 0

I'm using simplexml_load_string to load an xml file. Is it possible to order the xml returned by node name.

Example the xml is always returned ordered by <item> but I want to output by <distance>




Any help really appreciated.
3:32 pm on Feb 3, 2011 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 2

You will likely need to assign the nodes to an array (but if memory serves me correctly, they are already in an array) and then use a custom call back function to sort the array.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members