PHP implementation today is the day of the week. Copy the code as follows: the first method is $ dadate (w); if ($ da1) {echo today is Monday;} elseif ($ da2) {echo today is Tuesday ;} elseif ($ da3
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 ");
The http://www.bkjia.com/PHPjc/313573.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/313573.htmlTechArticle code is as follows: // The first statement $ da = date ("w"); if ($ da = "1") {echo "Today is Monday ";} else if ($ da = "2") {echo "Today is Tuesday";} else if ($ da = "3 "...