求解一下,为何当$a=0得出是二等奖,谢谢~
<?php $a=0; $b=""; switch ($a){ case $a<=1: $b="一等奖"; break; case $a<=5&&$a>1: $b="二等奖"; break; case $a<=9&&$a>5: $b="三等奖"; break; default: $b="没有奖"; } echo $b; ?>
<?php $a=0; $b=""; switch ($a){ case $a<=1: $b="一等奖"; break; case $a<=5&&$a>1: $b="二等奖"; break; case $a<=9&&$a>5: $b="三等奖"; break; default: $b="没有奖"; } echo $b; ?>
2016-06-29
举报