07-07-2010, 06:46 PM
|
#2 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
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 uasort.
- Essentially do the same as #2 but in an object-oriented manner with something like an ArrayObject from the Standard PHP Library.
|
|
|
|