Php checks the usage instance of the date function checkdate and the checkdate instance. Php checks the checkdate usage instance of the date function. the checkdate instance in this document describes the php checkdate usage of the date function. Share it with you for your reference. The specific analysis is as follows: php checks the checkdate usage instance of the date function in php and the checkdate instance.
This example describes how to use the php Date Check function checkdate. Share it with you for your reference. The specific analysis is as follows:
In php, you can use the checkdate function to verify the correctness of the date.
Syntax
integer checkdate (int %Month, int $Day, int $Year);
Demo code
<?PHPecho "2/29/1900";checkdate (2, 29, 1900)?print " is Valid":print " is not valid";echo "\n";echo "2/29/2000";checkdate (2, 29, 2000)?print " is Valid":print " is not valid";echo "\n";echo "2/29/2100";checkdate (2, 29, 2100)?print " is Valid":print " is not valid";echo "\n";echo "4/30/2008";checkdate (4, 30, 2008)?print " is Valid":print " is not valid";echo "\n";echo "4/31/2008";checkdate (4, 31, 2008)?print " is Valid":print " is not valid";echo "\n";?>
The output result is as follows:
2/29/1900 is not valid2/29/2000 is Valid2/29/2100 is not valid4/30/2008 is Valid4/31/2008 is not valid
I hope this article will help you with php programming.
The following example describes how to use the php Date Check function checkdate. Share it with you for your reference. The specific analysis is as follows: php...