Today is the day of the week in many ways, this article has compiled three commonly used, interested friends can understand
The Code is as follows:
// Method 1
$ 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 "your input is incorrect !! ";
};
// Method 2
$ Ga = date ("w ");
Switch ($ ga ){
Case 1: echo "Today is Monday"; break;
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;
Default: echo "your input is incorrect! ";
};
// Method 3
Echo "Today is the week". mb_substr ("May 25, 1234", date ("w"), 1, "UTF-8 ");