Home > Article > Backend Development > In PHP, translate the following: checkdate() function
checkdate() function verifies the Gregorian calendar date. Returns TRUE if the date is valid, FALSE otherwise.
checkdate(month, day, year)
Month - Specify the month as a number between 1 and 12
day - Specify the date as a number between 1 and 31
year - Specify the year as A number between 1 and 32767
The checkdate() function returns TRUE if the date is valid, otherwise it returns FALSE.
Here are the examples-
Live Demonstration
<?php var_dump(checkdate(10,29,2018)); ?>
bool(true)
Let’s see Another example -
Live demo
<?php $month = 9; $day = 30; $year = 2018; var_dump(checkdate($month, $day, $year)); ?>
bool(true)
The above is the detailed content of In PHP, translate the following: checkdate() function. For more information, please follow other related articles on the PHP Chinese website!