The PHP Checkdate function is used for validating the system date. It validate the Gregorian date. It returns 'True' if finds the specified date valid, otherwise it returns false.
The PHP Checkdate function is used for validating the system date. It validate the Gregorian date. It returns 'True' if finds the specified date valid, otherwise it returns false.
Check Date in PHP
The Checkdate()
The PHP Checkdate function is used for validating the system date. It validate the Gregorian date. It returns 'True' if finds the specified date valid, otherwise it returns false.
Note: A Gregorian date is valid if
Syntax
checkdate(month,day,year)
Parameter Description
month - month is essential parameter that specifies a month
day - Essential that specifies the day
year - year is also necessary that denotes the year.
Example
<?php
var_dump(checkdate(07,31,2009));
var_dump(checkdate(2,29,2009));
var_dump(checkdate(2,29,2008));
?>
The output of the code above will be:
bool(true)
bool(false)
bool(true)