已采纳回答 / Culdesac
因为 $sex = "男"; 所以只运行if($sex == "男"){ $totalMoney = $basicMoney + 0;//男的没奖金 }而下面这段是$sex=="女";的时候才会运行 else if($sex == "女"){//否则性别为女的话 $totalMoney = $basiceMoney + 300;//奖金300 }
2017-07-06
最新回答 / 加油54
echo ($a and $b)?"通过":"不通过"; echo "<br />"; echo ($a or $b)>"通过":"不通过"; echo "<br />"; echo ($a xor $c Xor $d)?"通过":"不通过"; echo "<br />"; echo !$c?"通过":"不通过"; echo "<br />"; echo $a && $b?"通过":"不通过"; echo "<br />"...
2017-07-06
date_default_timezone_set('Asia/ShangHai');
$today = date('m-d',time());//获取当天日期
$birthday = "06-06";//生日
$money = 238;//消费金额
$discount = 0.8;//八折优惠
if($today == $birthday)$money *= $discount;
echo $money;
$today = date('m-d',time());//获取当天日期
$birthday = "06-06";//生日
$money = 238;//消费金额
$discount = 0.8;//八折优惠
if($today == $birthday)$money *= $discount;
echo $money;
2017-07-06