note 87734 deleted from function.min by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:03:37 +0000 |
| Subject: | note 87734 deleted from function.min by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196778@lists.php.net to get a copy of this message | ||
Note Submitter: andrew dot j dot dodson at gmail
----
min/max works with yyyy-mm-dd dates, e.g.
<?php
$a = array( '2008-10-01', '2008-12-01' );
print min($a); // '2008-10-01'
print max($a); // '2008-12-01'
?>
Which is a unexpected since at the top of this page it says.
"PHP will evaluate a non-numeric string as 0"
And if we cast it as an int then we get the year
<?php
print (int)"2008-01-12"; // 2008
?>