Jump to content

Large array of numbers, get lowest 5?


aximbigfan

Recommended Posts

Hi,

 

I have a large array of numbers. How can I get a set of the names of 5 of the lowest?

 

 

For example:

bigarray

{

  0 => 23

  1 => 45

  2 => 56

  3 => 0

  4 => 41

  5 => 3

  6 => 2

  7 => 7

}

 

and the set of 5 would b e created in an array like this

unpop

{

  0 => 3 (These are the NAMES of the keys, not the value)

  1 => 2

  2 => ...............

 

Thanks!

Chris

 

 

Link to comment
https://forums.phpfreaks.com/topic/125498-large-array-of-numbers-get-lowest-5/
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.