怎么結(jié)果是不打折?
$today = date('m-d',time());//獲取當(dāng)天日期
$birthday = "11-17";//生日
$mony = 100;
$discount=0.8;
if($today==$birthday)
{
? ? $mony = $mony*$discount;//打八折
}else{
? ? $mony = $mony;//不打折
}
echo $mony
$today = date('m-d',time());//獲取當(dāng)天日期
$birthday = "11-17";//生日
$mony = 100;
$discount=0.8;
if($today==$birthday)
{
? ? $mony = $mony*$discount;//打八折
}else{
? ? $mony = $mony;//不打折
}
echo $mony
2019-11-07
舉報(bào)
2021-08-30
檢測條件是如果當(dāng)天日期=生日日期執(zhí)行打折語句,但你當(dāng)天不是生日,所以不打折
2019-11-18
看判斷條件?$today==$birthday?
2019-11-09
在生日的當(dāng)天才能打折,所以11月17號才會(huì)打折