note 95367 added to function.max
| From: | vendelin8 at gmail dot com | Date: | Tue, 29 Dec 2009 14:16:10 +0000 |
| Subject: | note 95367 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-164434@lists.php.net to get a copy of this message | ||
I disagree with sumeruter that in case of a recursive array php returnes the sub-array containing
the highest value recursively. It checks the first value.
Eg.
$array = array(array(2, 3, 4), array(1, 4, 5));
print_r(max($array));
result:
Array ( [0] => 2 [1] => 3 [2] => 4 )
In sumeruter's example the maximal value was always in the array that has the highest first
value as well.
----
Server IP: 69.147.83.197
Probable Submitter: 80.85.48.199
----
Manual Page -- http://www.php.net/manual/en/function.max.php
Edit -- https://master.php.net/note/edit/95367
Del: integrated -- https://master.php.net/note/delete/95367/integrated
Del: useless -- https://master.php.net/note/delete/95367/useless
Del: bad code -- https://master.php.net/note/delete/95367/bad+code
Del: spam -- https://master.php.net/note/delete/95367/spam
Del: non-english -- https://master.php.net/note/delete/95367/non-english
Del: in docs -- https://master.php.net/note/delete/95367/in+docs
Del: other reasons-- https://master.php.net/note/delete/95367
Reject -- https://master.php.net/note/reject/95367
Search -- https://master.php.net/manage/user-notes.php