note 76281 deleted from function.checkdate by sobak
| From: | sobak@php.net | Date: | Tue, 22 Nov 2016 10:31:51 +0000 |
| Subject: | note 76281 deleted from function.checkdate by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207510@lists.php.net to get a copy of this message | ||
Note Submitter: a34 at yahoo dot com
----
checkData function posted below does not consider a date entered such as 03/27c/2000. The c will
cause it to crash. Here is the fix.
<?php
function checkData($mydate) {
list($yy,$mm,$dd)=explode("-",$mydate);
if (is_numeric($yy) && is_numeric($mm) && is_numeric($dd))
{
return checkdate($mm,$dd,$yy);
}
return false;
}
?>