PHP eldest brother Elder sisters, help younger brother I solve a problem

Source: Internet
Author: User
PHP eldest brother Elder sisters, help me solve a problem
I have a variable: $strDate, the value of this variable may be 2012-01-09 or 2008-05-06 ... Uncertain is any day of all time,
Now I want to return to the month where the value becomes

In other words: Returns the month of the specified date,

When $STRDATE=2012-08-06 is returned: 8
When $STRDATE=2010-02-06 is returned: 2
When $STRDATE=2006-08-06 is returned: 8
When $STRDATE=2015-08-06 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.