pocobueno1388 Posted June 21, 2010 Share Posted June 21, 2010 I am having issues sorting an array that come from a SimpleXMLElement Object. The array looks like this: SimpleXMLElement Object ( [www] => SimpleXMLElement Object ( [allen] => SimpleXMLElement Object ( [city] => Allen [area] => Allen [county] => Collin [state] => Texas ( ) [newcontent] => text content ) [addison] => SimpleXMLElement Object ( [city] => Addison [area] => Addison [county] => Dallas [state] => Texas ( ) [newcontent] => text content ) [amarillo] => SimpleXMLElement Object ( [city] => Amarillo [area] => Amarillo [county] => Potter [state] => Texas ( ) ) ) I want to sort it by city in alphabetical order. This array is being populated from an XML file. I know you can make a XSLT template to sort an XML file, but I can't figure out how to do that. If anyone could help, it would be greatly appreciated. Thanks! Link to comment https://forums.phpfreaks.com/topic/205476-sorting-a-multidimensional-array-by-certain-key/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.