This function returns true if the specified date is valid, and false otherwise.

A date is valid if:

* month is between 1 and 12 inclusive
* day is within the allowed number of days for the particular month
* year is between 1 and 32767 inclusive

Syntax: checkdate(month,day,year)

Description:

The first parameter “month” is Required. It Specifies the month.

The second parameter “day” is Required. It Specifies the day.
The first parameteryear Specifies the year

Example1:
Code:

if(checkdate(12, 30, 2010))
{
echo "The date is valid"."
"; } else { echo "The date is not valid"; }

Output:

The date is valid

Example2:
Code:

if(checkdate(2, 29, 2003))
{
echo   "The date is valid";

}
else
{
echo "The date is not valid";
}

Output:

The date is not valid

eXTReMe Tracker