Big Brother and sister of php, help me solve a problem-php Tutorial

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... not always any day of all time, now I want to return the month where this value is changed. that is to say: return the month of the specified date when $ strDate2012-08-06 is returned: 8 when $ strDate2010-02-06 is returned: 2 when $ strD php's big brother-in-law, 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 ));

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.