PHP judgment is the day of the week solution

Source: Internet
Author: User

// 
$da = Date ("W"),  ,
if ($da = = "1") { 
echo "Today is Monday";  
}else if ($da = = "2") {& nbsp
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 mistyped!! ";  
}; 
//second notation  
$ga = Date ("w");  
Switch ($GA) { 
Case 1:echo "Today is Monday";  
Case 2:echo "Today is Tuesday"; break; 
Case 3:echo "Today is Wednesday"; break; 
Case 4:echo "Today is Thursday"; break;  ;
Case 5:echo "Today is Friday"; break; 
Case 6:echo "today is Saturday"; break; 
Case 0:echo "Today is Sunday"; break; 
D Efault:echo "you entered the wrong!" ";  
}; 
//Third  

Echo" Today is Week ". Mb_substr ("Day 123456", Date ("W"), 1, "Utf-8"),  

Don't understand can consult old Ant Technical Department 18107823062 same number

PHP judgment is the day of the week solution

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.