对于不同case值对应一个指令的情况可参考写成一堆(有错请指正)
switch statement----
switch($num){
case 1;
case 2;
case 3:
echo "是1或2或3";
case 4;
case 5:
echo "是4或5";
default:
echo "是(除了上述外的)其他数字";
}
switch statement----
switch($num){
case 1;
case 2;
case 3:
echo "是1或2或3";
case 4;
case 5:
echo "是4或5";
default:
echo "是(除了上述外的)其他数字";
}
2018-05-19
date_default_timezone_set('asia/shanghai');
$week = date("w");//获取当天星期几
$info = "";//提示信息
if($week==1){
$info = "上午有课";
}else if($week==3){
$info = "下午有课";
}else{
$info = "今天没课";
}
echo $info; //输出提示信息
?>
$week = date("w");//获取当天星期几
$info = "";//提示信息
if($week==1){
$info = "上午有课";
}else if($week==3){
$info = "下午有课";
}else{
$info = "今天没课";
}
echo $info; //输出提示信息
?>
2018-05-14