Copy Code code as follows:
The first form of writing
$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 the wrong!!";
};
The second way
$ga = Date ("W");
Switch ($GA) {
Case 1:echo "Today is Monday";
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 typed in the wrong!" ";
};
The third way of writing
echo "Today is the Week". Mb_substr ("Day 123456", Date ("W"), 1, "utf-8");