note 53530 deleted from function.max by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 11:38:20 +0000 |
| Subject: | note 53530 deleted from function.max by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106745@lists.php.net to get a copy of this message | ||
Note Submitter: zher0 at netcarrier dot com
----
---> walkingmantis
Your example does not work with multidimensional arrays that have 'sub arrays' of
different sizes. The following code returns 25 as the maximum value.
<?php
$a1 = array(1,3,25);
$a2 = array(26,50);
$a3 = array(51,75);
$a4 = array(76, 100);
$a = array($a1,$a2,$a3,$a4);
echo $aMax = max(max($a));
?>
Output:
3