note 53530 added to function.max
| From: | zher0 at netcarrier dot com | Date: | Sun, 05 Jun 2005 03:31:03 +0000 |
| Subject: | note 53530 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89929@lists.php.net to get a copy of this message | ||
---> 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
----
Manual Page -- http://www.php.net/manual/en/function.max.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53530
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53530&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53530&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53530&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53530&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53530&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53530&report=yes
Search -- http://master.php.net/manage/user-notes.php