XtremeGamer99
09-19-2009, 08:21 AM
Trying to get back into coding, and I'm currently working on a new project. Let me get right to the chase.
Lets say I have an array:
[3017496] => 15
[3017678] => 9
[3017114] => 8
[3017297] => 10
[3017428] => 9
[3017440] => 6
[3017683] => 5
[3017306] => 11
[3017461] => 8
[3017529] => 6
[3017683] => 5
I'm trying to return the minimum values of this array. min() work pretty well, but it only returns an number, and it doesn't discriminate over how many of the lowest value there are.
Taking that array as an example, min() only returns 5. However, I need this:
[3017683] => 5
[3017683] => 5
I could always just make a foreach function and compare all the values while throwing out ones higher than others until it comes down to what I need, but I wanted to ask here to see if there's already a function to do this.
Thanks!
Lets say I have an array:
[3017496] => 15
[3017678] => 9
[3017114] => 8
[3017297] => 10
[3017428] => 9
[3017440] => 6
[3017683] => 5
[3017306] => 11
[3017461] => 8
[3017529] => 6
[3017683] => 5
I'm trying to return the minimum values of this array. min() work pretty well, but it only returns an number, and it doesn't discriminate over how many of the lowest value there are.
Taking that array as an example, min() only returns 5. However, I need this:
[3017683] => 5
[3017683] => 5
I could always just make a foreach function and compare all the values while throwing out ones higher than others until it comes down to what I need, but I wanted to ask here to see if there's already a function to do this.
Thanks!