note 72050 added to function.checkdate
| From: | tjo44 at hotmail dot com | Date: | Sat, 30 Dec 2006 22:40:11 +0000 |
| Subject: | note 72050 added to function.checkdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121119@lists.php.net to get a copy of this message | ||
If you don't want to double check for empty fields and THEN whether the date is correct use the
following:
<?php
if ( checkdate( (int)$_POST['month'], (int)$_POST['day'],
(int)$_POST['year'] ) )
{
echo 'Correct date found.';
}
else
{
echo 'Incorrect date, or missing fields (which result in 0 due to the (int) in front of the
variable) found.';
}
?>
----
Server IP: 194.109.193.94
Probable Submitter: 62.194.39.34
----
Manual Page -- http://www.php.net/manual/en/function.checkdate.php
Edit -- https://master.php.net/note/edit/72050
Del: integrated -- https://master.php.net/note/delete/72050/integrated
Del: useless -- https://master.php.net/note/delete/72050/useless
Del: bad code -- https://master.php.net/note/delete/72050/bad+code
Del: spam -- https://master.php.net/note/delete/72050/spam
Del: non-english -- https://master.php.net/note/delete/72050/non-english
Del: in docs -- https://master.php.net/note/delete/72050/in+docs
Del: other reasons-- https://master.php.net/note/delete/72050
Reject -- https://master.php.net/note/reject/72050
Search -- https://master.php.net/manage/user-notes.php