Jump to content

Sorting multidimensional arrays


Symmetry

Recommended Posts

I have an array that is for example structured as the following:

 

$array['name'][index]

$array['count'][index]

or

$array[index]['name']

$array[index]['count']

 

Where 'count' is a number of records associated with the 'name'.. I'd like to re-sort the array by 'count' descending, but I need to maintain an association to the 'name' values... array_multisort seems to reorganize the array by 'count' but I lose the 'name'. Thank you!

Link to comment
https://forums.phpfreaks.com/topic/97582-sorting-multidimensional-arrays/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.