I think it should be a simple function to determine whether the date is valid, but it is still a bit cumbersome to think about it, because it is necessary to test the format, but also to check the validity. For example, 2013-02-29, although the
Php uses the strtotime and date functions to determine whether the date is valid for code sharing. In my opinion, judging whether a date is valid should be a simple function, but it is still a little troublesome to think about it, because we need to
Php uses the strtotime and date functions to test and judge whether the date is valid for code sharing. For more information, see.
Php uses the strtotime and date functions to test and judge whether the date is valid for code sharing. For more
Php uses the strtotime and date functions to test and judge whether the date is valid for code sharing. For details, it is quite simple to judge whether the date is valid, however, it is still a bit difficult to remember, because we need to check
Check whether the date is valid
Check whether the date is valid
Function check_date ($ date) {// check whether the date is valid
$ DateArr = explode ("-", $ date );
If (is_numeric ($ dateArr [0]) & is_numeric ($
php Use the strtotime and date functions to check whether the date is valid code sharing, please refer to the use of the bar First of all, it should be a simple function to judge whether the date is effective, but it's still a bit troublesome to
Php uses the strtotime and date functions to test and judge whether the date is valid for code sharing. for details, it is quite simple to judge whether the date is valid, however, it is still a bit difficult to remember, because we need to check
The following summarizes several ways to use PHP to verify that the date entered by the user is the correct date Oh, a friend who needs to refer to the reference.
The Checkdate () function validates a trellis-high-date.
Example
The code
PHP Date-time function date ()1, year-month-day
Copy Code code as follows:
echo Date (' y-m-j ');
2007-02-6
echo Date (' y-n-j ');
07-2-6
Capital Y represents a four-digit year, while lowercase y represents a
Date () is a commonly used date-time function, let me summarize the date () function of the various forms of usage, there is a need to learn the friend can refer to.Formatted dateThe first parameter of the date () function specifies how the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.