Check if some dates are valid Gregorian dates:
<?phpvar_dump(checkdate(12,31,-400));echo "<br>";var_dump(checkdate(2,29,2003));echo "<br>";var_dump(checkdate(2,29,2004 ));?>The checkdate() function is used to verify Gregorian dates.
checkdate( month,day,year);
| parameter | describe |
|---|---|
| month | Required. A number from 1 to 12 specifying the month. |
| day | Required. A number from 1 to 31 specifying the day. |
| year | Required. A number from 1 to 32767 specifying the year. |
| Return value: | Returns TRUE if the date is valid, FALSE otherwise. |
|---|---|
| PHP version: | 4.0+ |