switch循環(huán)判斷
作者: 來(lái)源: 發(fā)布時(shí)間:2011-5-25 15:13:46 點(diǎn)擊:
.本文章分享的關(guān)于switch循環(huán)判斷的一個(gè)實(shí)例,供PHP初學(xué)者學(xué)習(xí),希望對(duì)大家有用。
<?php
switch(date("D")){
case "Mon":
echo "星期一";
break;
case "Tue":
echo "星期二";
break;
case "Wed":
echo "星期三";
break;
case "Thu":
echo "星期四";
break;
case "Fri":
echo "星期五";
break;
case "Sat":
echo "星期六";
break;
default:
echo "星期日";
break;
}
?>
switch(date("D")){
case "Mon":
echo "星期一";
break;
case "Tue":
echo "星期二";
break;
case "Wed":
echo "星期三";
break;
case "Thu":
echo "星期四";
break;
case "Fri":
echo "星期五";
break;
case "Sat":
echo "星期六";
break;
default:
echo "星期日";
break;
}
?>
如果是星期幾就會(huì)輸出星期幾.比如說(shuō)今天是星期四,就會(huì)輸出星期四。
[收藏此文章]