How To Use Function checkdate() Using PHP
Submitted by alpha_luna on Monday, June 22, 2015 - 22:25.
Good Day!!!
In this tutorial, we are going to learn PHP function, and it's called "checkdate()". The checkdate() 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
checkdate(month,day,year)
month - specifies the month (between 1 and 12 inclusive ). (required)
day - specifies the day (within the allowed number of days for the given month). (required)
year - specifies the year (between 1 and 32767 inclusive). (required)
Example:
The following example shows the basic use of this function.
This produces the following result:
bool(true) bool(false) bool(true)
Add new comment
- 26 views