<?php
date_default_timezone_set('Asia/ShangHai');
$today = date('m-d',time());//获取当天日期
$birthday = "02-14";//生日
$money = 238;//消费金额
$discount = 0.8;//八折优惠
if(!($birthday==$today)){
$money=$money*1;
}else{
$money=$money*$discount;
}
echo $money;
?>
第6行"if(!($birthday==$today)){"有没有试过把里面的感叹号去掉,即"if($birthday==$today){"