Quote:
|
Originally Posted by mrthumbs
What i really need to check if value_1 is the highest value of the 50..
so value_1 > then v2,v3,v4,v5,v6 etc..
Thats why i need a way to loop through all these vars without having
50 lines of text..
I could move the data to an array and loop through there but i still need
to compare the vars individually..
Hmm.. i could load it into an array.. do a sort.. and see if the highest number
equals value_1 AND is unique in the array....
|
To do it with a loop, you could do something like:
PHP Code:
$high_value = $array[0];
$high_key = 0;
foreach ($array as $key=>$value) {
if ($value > $high_value) {
$high_value = $value;
$high_key = $key;
}
}
However since their are only 50 items, yes sort might be faster.