Today is the day of the week PHP

Source: Internet
Author: User
Today is the day of the week PHP
The first notation $da = Date ("W"), if ($da = = "1") {    echo "today is Monday";} else if ($da = = "2") {    echo "today is Tuesday";} else if ($da = = "3") {    echo "today is Wednesday";} else if ($da = = "4") {    echo "today is Thursday";} else if ($da = = "5") {    echo "today is Friday";} else if ($da = = "6") {    echo "today is Saturday";} else if ($da = = "0") {    echo "today is Sunday";} else{    echo "you entered wrong!";};/ /second notation $ga = Date ("W"), switch ($GA) {case    1:echo "today is Monday"; break;    Case 2:echo "Today is Tuesday";    Case 3:echo "Today is Wednesday";    Case 4:echo "Today is Thursday";    Case 5:echo "Today is Friday";    Case 6:echo "Today is Saturday";    Case 0:echo "Today is Sunday";    Default:echo "you entered the wrong!" ";};/ /The Third Way echo "Today is Week". Mb_substr ("Day 123456", Date ("W"), 1, "utf-8");
  • Related Article

    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.