note 71529 added to function.checkdate
| From: | manuel84**at**mp4**dot**it at osu1 dot php dot net | Date: | Mon, 04 Dec 2006 15:49:44 +0000 |
| Subject: | note 71529 added to function.checkdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-120270@lists.php.net to get a copy of this message | ||
If you have a date like this gg/mm/aaaa and you'd like to verify that it is in the Italian
Format you can use a function like this.
For other date format you can take this code and simply modify the list and explode line
<?php
/**
* check a date in the Italian format
*/
function checkData($date)
{
if (!isset($date) || $date=="")
{
return false;
}
list($dd,$mm,$yy)=explode("/",$date);
if ($dd!="" && $mm!="" && $yy!="")
{
return checkdate($mm,$dd,$yy);
}
return false;
}
?>
----
Server IP: 213.92.11.19
Probable Submitter: 82.90.140.50
----
Manual Page -- http://www.php.net/manual/en/function.checkdate.php
Edit -- https://master.php.net/note/edit/71529
Del: integrated -- https://master.php.net/note/delete/71529/integrated
Del: useless -- https://master.php.net/note/delete/71529/useless
Del: bad code -- https://master.php.net/note/delete/71529/bad+code
Del: spam -- https://master.php.net/note/delete/71529/spam
Del: non-english -- https://master.php.net/note/delete/71529/non-english
Del: in docs -- https://master.php.net/note/delete/71529/in+docs
Del: other reasons-- https://master.php.net/note/delete/71529
Reject -- https://master.php.net/note/reject/71529
Search -- https://master.php.net/manage/user-notes.php