Date Validation
Date Validation
checkdate
checkdate
This function Validate a gregorian date/time.
Syntax:
——-
bool checkdate ( int month, int day, int year)
It returns TRUE if the date given is valid; otherwise
returns FALSE. Checks the validity of the date formed by the arguments.
A date is considered valid if:
the year is between 1 and 32767 inclusive
the month is between 1 and 12 inclusive
the Day is within the allowed number of days for the given month.
Leap years are also taken into consideration.
Example:
———-
echo checkdate(2,29,2007);
It returns FALSE.
Similarly given as
echo checkdate(2,29,2004);
It returns TRUE. because 2004 is leap year.
