note 34767 added to ref.array
| From: | ap at aaronparecki dot com | Date: | Wed, 06 Aug 2003 03:40:07 +0000 |
| Subject: | note 34767 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53474@lists.php.net to get a copy of this message | ||
the max($array) function didn't work for me, so I wrote my own.
function array_max_value( $array ) {
foreach( $array as $item ) {
if( intval($item) > intval($maxvalue) ) {
$maxvalue = intval($item);
}
}
return $maxvalue;
}
Of course, this only works with integer values, but can be easily modified.
----
Manual Page -- http://www.php.net/manual/en/ref.array.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34767
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34767&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34767&report=yes