sorting simplexml data by date
View Single Post
07-07-2010, 06:46 PM
Join Date: Apr 2007
There are lots of different ways to do this: here are three ideas.
Use XSL to transform the XML document into one which has the items sorted as you want. This has the advantage of simplicity since your PHP will just see the new, sorted XML and doesn't have to do anything special.
Simply push the elements that you want sorted to an array, then sort that array; perhaps with
Essentially do the same as #2 but in an object-oriented manner with something like an
Standard PHP Library
The Following User Says Thank You to Salathe For This Useful Post:
View Public Profile
Send a private message to Salathe
Visit Salathe's homepage!
Find More Posts by Salathe