Martin Holm wrote:
Daniel Schierbeck wrote:

I've been looking at php.net, but i couldn't find what i'm searching for.

I have a numeric array, and i'd like to get the highest key. E.g.

    $arr = array(3 => "foo", 7 => "bar", 43 => "foobar");

What i want is a function that, in this case, returns 43.


Daniel Schierbeck

$arr = array(3 => "foo", 7 => "bar", 43 => "foobar");

krsort($arr);

$highestkey = key($arr);


Oops, he wanted the key. Martin's right. My suggestion would have given you the value, not the key.


--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to