note 79772 deleted from function.min by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 15:28:18 +0000 |
| Subject: | note 79772 deleted from function.min by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133568@lists.php.net to get a copy of this message | ||
Note Submitter: xhostar at hotmail dot com
Reason: 1
----
as dave said:
>empty strings '' will also return false or 0, so if you have
>something like
>$test = array('', 1, 5, 8, 44, 22);
>'' will be returned as the lowest value
This could be a solution:
echo min(array_filter(array('', 1, 5, 8, 44, 22),"is_numeric")); // output: 1