Php gets the day of the week in a few days and the corresponding day of the week on Monday and next Monday _ PHP Tutorial

Source: Internet
Author: User
Php gets the day of a day, the day of the week, and the date corresponding to the day of the week and the day of the week. Php returns the day of a day, the day of a week, and the date $ todaydate (Y-m-d) corresponding to Monday and next Monday. echo $ today; to obtain the number of today. Output define a number of php to get the day of the day and the day of the week on Monday and next Monday

$ Today = date ("Y-m-d ");

Echo $ today; // you can get the number of today. Output

// Define an array first.

$ Rows = array ("day", "one", "two", "three", "four", "five", "six ");
Echo "today is the week". $ rows [date ("w")]."
";

// Note date ("w"). you can obtain the number of weeks, for example, 123. Note that 0 is Sunday. The subscript of the array starts from 0.

// Quickly obtain the corresponding date of the week

Echo "this Monday is". date ('Y-m-D', strtotime ("this Monday "))."
"; // Output. because today is just Monday, the result is special. if you are interested, open it tomorrow to see if the result is correct.

// Quickly obtain the date corresponding to the next Monday

Echo "this Monday is". date ('Y-m-D', strtotime ("next Monday "))."
"; // Output

?>

PS: The strtotime () function parses the datetime description of any English text into a Unix timestamp.

Attach the corresponding weekly English: Monday ['m? Ndi, 'M? Ndei]

Tuesday ['tju: zdi]
Wednesday on Wednesday ['wenzdei, 'wenzdi]

Thursday on Thursday ['θ? : Zdi]

Friday ['fraidi]
Saturday ['s? T? Di]

Sunday ['s? Ndi]

Today $ today = date ("Y-m-d"); echo $ today; // you can get the number of today. Output // define a number first...

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.