I used similar and just put it into a function

function array_max($array)
    return current($array);

this just gives me the first element of the array.


  Chris Lee

"Patrick Meisel" <[EMAIL PROTECTED]> wrote in message

I need to get the highest value of a hash. I first just wanted to do an
arsort and then access the first value with $data[0], which didnīt work. I
guess you canīt access associative arrays by index.
So I found this way to do it (as the $data array needs to remain unchanged):
          arsort ($temp);

Is there really no shorter way to do it??


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to