chiprivers Posted February 20, 2007 Share Posted February 20, 2007 Once a multidimensional array has been created, is there away I can reorder the top level array by a value within the nested arrays? Link to comment https://forums.phpfreaks.com/topic/39311-reordering-a-multidimensional-array/ Share on other sites More sharing options...
dustinnoe Posted February 20, 2007 Share Posted February 20, 2007 just use sort() php will sort multidimensional arrays by the first key, then second and so on. You will also need to sort each embedded array so that the keys are in the order you wish to sort. Link to comment https://forums.phpfreaks.com/topic/39311-reordering-a-multidimensional-array/#findComment-189518 Share on other sites More sharing options...
JBS103 Posted February 20, 2007 Share Posted February 20, 2007 Also see array_multisort() http://us2.php.net/manual/en/function.array-multisort.php Link to comment https://forums.phpfreaks.com/topic/39311-reordering-a-multidimensional-array/#findComment-189583 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.