Big Brother and sister of php, help me solve a problem
Source: Internet
Author: User
Php's big brother and sister, help me solve a problem. I have a variable: $ strDate. the variable value may be or... it cannot be any day of all time. now I want to return the month in which the value is changed. that is to say, the month of the specified date is returned. when $ strDate = 2012-08-06 is returned: 8 when $ php's big sisters help me solve a problem
I have a variable: $ strDate, which may be or... not necessarily any day of all time,
Now I want to return the month in which the value is changed.
That is, the month of the specified date is returned,
If $ strDate = 2012-08-06 is returned: 8
If $ strDate = 2010-02-06 is returned: 2
If $ strDate = is returned: 8
If $ strDate = is returned: 8
What is this function '>?
------ Solution --------------------
Echo date ('N', strtotime ($ strDate ));
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.