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
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
Formatted dateThe first parameter of the date () function specifies how the date/time is formatted. It uses letters to represent the format of dates and times. Here is a list of some availableThe letters:D-Day of the month (01-31)• M-Current month,
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 date/
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.