landysaccount Posted August 2, 2009 Share Posted August 2, 2009 Hello. I'm trying to sort a multidimensional array but, can't do it. For example, I have an array: $cust[id][lname][fname]; and I would like to be able to sort it by lname or fname, how can I do it? I've tried sort( $cust[][lname][] ) But, can't really get it to work. Any ideas? Thanks in advanced for your help. Link to comment https://forums.phpfreaks.com/topic/168556-solved-how-to-sort-a-multidimesional-array/ Share on other sites More sharing options...
ldougherty Posted August 2, 2009 Share Posted August 2, 2009 You will want to use the array_multisort function http://us2.php.net/manual/en/function.array-multisort.php Link to comment https://forums.phpfreaks.com/topic/168556-solved-how-to-sort-a-multidimesional-array/#findComment-889147 Share on other sites More sharing options...
landysaccount Posted August 2, 2009 Author Share Posted August 2, 2009 Thanks for guiding me to the right path. Link to comment https://forums.phpfreaks.com/topic/168556-solved-how-to-sort-a-multidimesional-array/#findComment-889149 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.