checkdate($month, $day, $year) - will return true or false
<?php
//checkdate($month, $day, $year) - format
$month = 10;
$day = 12;
$year = 2008;
echo 'Valid Date Example: ';
if(checkdate($month, $day, $year))
{
echo 'Date is correct';
}
else
{
echo 'Date is incorrect';
}
echo '<br /><br />';
echo 'Invalid Date Example: ';
//Invalid date
$month = 14; // month is wrong
$day = 12;
$year = 2008;
if(checkdate($month, $day, $year))
{
echo 'Date is correct';
}
else
{
echo 'Date is incorrect';
}
?>
Get Free Sinhala IT Learning Videos Kuppiya.com
No comments:
Post a Comment