php date validation function

checkdate can determine whether an output date is valid.

In actual work, we often need to detect data validation commonly used for user submission forms.

For example: Verify whether the time entered by the user is correct.

The syntax format of the function is as follows:

bool checkdate (int $month, int $day, int $year)

In the following example, we You can use a code to conduct experiments and write a real example. Try to see if there is February 29, 2011.

Return true if it is a valid time, return false if it is not a valid time.

Output result:

bool(true)
bool(false)


Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!