Re: Highest Key in an Array
| From: | Martin Holm | Date: | Fri, 17 Sep 2004 15:11:20 +0000 |
| Subject: | Re: Highest Key in an Array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196953@lists.php.net to get a copy of this message | ||
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.krsort($arr); $highestkey = key($arr);$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");