physaux Posted November 17, 2009 Share Posted November 17, 2009 Is there a quick function that could do this, or do I have to make one? I have: myarray[1]['points'] = 4 myarray[2]['points'] = 8 myarray[3]['points'] = 32 myarray[4]['points'] = 2 ... myarray[64]['points'] = 52 The array has 64 elements, and will always have different numbers. How can I sort the array, so that the biggest number is first, but I still need to know its index. Anyone have any idea :confused: Quote Link to comment https://forums.phpfreaks.com/topic/181905-how-can-i-sort-an-array-by-its-contents-but-keep-related-indexes-values/ Share on other sites More sharing options...
Alex Posted November 17, 2009 Share Posted November 17, 2009 arsort() Quote Link to comment https://forums.phpfreaks.com/topic/181905-how-can-i-sort-an-array-by-its-contents-but-keep-related-indexes-values/#findComment-959421 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.