源自:6-3 PHP条件结构之if…else if…
为什么当$sex=男时结果是0呢?
<?php
$totalMoney = 0;//总工资
$basicMoney = 2000;//基本工资
$sex = "男";
$month = 3;
if($sex == "男"){
$totalMongy = $basicMoney;
}else if($month == 3 && $sex == "女"){
$totalMoney = $basicMoney + 300;
}
echo $totalMoney;
?>
提问者:宗瀚
2016-02-15 16:29