note 93001 added to function.max
| From: | christiaan at baartse dot nl | Date: | Wed, 19 Aug 2009 07:29:23 +0000 |
| Subject: | note 93001 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159624@lists.php.net to get a copy of this message | ||
@stuff at necr0manzer dot de
Wouldn't
$key = array_search(max($array), $array);
yield the same as your
$key = max_key($array);
and if you really want a function for it
function max_key($array) {
return array_search(max($array), $array);
}
----
Server IP: 83.137.20.135
Probable Submitter: 91.197.72.16
----
Manual Page -- http://www.php.net/manual/en/function.max.php
Edit -- https://master.php.net/note/edit/93001
Del: integrated -- https://master.php.net/note/delete/93001/integrated
Del: useless -- https://master.php.net/note/delete/93001/useless
Del: bad code -- https://master.php.net/note/delete/93001/bad+code
Del: spam -- https://master.php.net/note/delete/93001/spam
Del: non-english -- https://master.php.net/note/delete/93001/non-english
Del: in docs -- https://master.php.net/note/delete/93001/in+docs
Del: other reasons-- https://master.php.net/note/delete/93001
Reject -- https://master.php.net/note/reject/93001
Search -- https://master.php.net/manage/user-notes.php