View Single Post
Old 10-15-2005, 02:30 PM  
Varius
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: New York, NY
Posts: 6,890
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.
__________________
Skype variuscr - Email varius AT gmail
Varius is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote