note 95367 deleted from function.max by thiago
| From: | thiago@php.net | Date: | Tue, 29 Dec 2009 16:59:55 +0000 |
| Subject: | note 95367 deleted from function.max by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164439@lists.php.net to get a copy of this message | ||
Note Submitter: vendelin8 at gmail dot com
----
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.