September 2001
Intermediate to advanced
768 pages
32h 45m
English
int checkdate(int month, int day, int year)
| month | Number of month |
| day | Number of day |
| year | Number of year |
Checks a date for numeric validity.
Returns:
TRUE on success; FALSE on failure
Description:
Checks whether the given arguments form a valid date. The function allows for months of differing lengths and for leap years. A useful function for checking and validating form input in which a date is required. The allowed range for the year values is 0 to 32767 (inclusive).
Note that you can use mktime() to correct out-of-range dates, if appropriate.
Version:
PHP 3, PHP 4
See also:
getdate() mkdate() date() mktime()
Example:
/* Expected output: * * Incorrect date; perhaps you meant March 1, 2001? */ $month ... |
Read now
Unlock full access