note 87680 added to function.max
| From: | snob at osu1 dot php dot net | Date: | Tue, 16 Dec 2008 18:59:35 +0000 |
| Subject: | note 87680 added to function.max | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148223@lists.php.net to get a copy of this message | ||
<?php
function min_alt($arr) {
$min_alt = $arr[0];
for ($count = 1; $count < count($arr); $count++) {
$min_alt = ($arr[$count] < $min_alt) ? $arr[$count] : $min_alt;
}
return $min_alt;
}
$array = array('dirty bastard', '3cats', 'five', 1.6, 2.598,
'take5', 8);
echo "min_alt: ". min_alt($array); // we get 'take5'
?>
----
Server IP: 80.64.47.13
Probable Submitter: 89.7.110.94
----
Manual Page -- http://www.php.net/manual/en/function.max.php
Edit -- https://master.php.net/note/edit/87680
Del: integrated -- https://master.php.net/note/delete/87680/integrated
Del: useless -- https://master.php.net/note/delete/87680/useless
Del: bad code -- https://master.php.net/note/delete/87680/bad+code
Del: spam -- https://master.php.net/note/delete/87680/spam
Del: non-english -- https://master.php.net/note/delete/87680/non-english
Del: in docs -- https://master.php.net/note/delete/87680/in+docs
Del: other reasons-- https://master.php.net/note/delete/87680
Reject -- https://master.php.net/note/reject/87680
Search -- https://master.php.net/manage/user-notes.php