Jump to content

How can I sort an array by its contents?, but keep related indexes + values??


physaux

Recommended Posts

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: :confused: :confused:

 

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.