如果 MySQL 的日期 = 2013-12-25 & $daydiff = "anything",我试图将我的输出设置为“未确认的日期”,如果 MySQL date = "NULL" & 和 $daydiff,则输出“不可用” =“任何东西”
我下面的代码似乎不起作用,有什么建议或替代方案吗?
$ArrivalDate == $variants_data['ArrivalDate'];
$daydiff=floor((abs(strtotime(date("Y-m-d")) - strtotime($ArrivalDate))/(60*60*24)));
if ( $daydiff == '%wildcard%' && $ArrivalDate == '2013-12-25') {
$ETA ='Date Not Confirmed';
}
elseif ( $daydiff == '%wildcard%' && $ArrivalDate == 'NULL') {
$ETA ='Not available';
}
elseif ( $daydiff > 30 && $daydiff < 60 ) { // anything between 31 and 59 days is 1 month
$ETA ='1 Month';
}
elseif ( $daydiff > 60 && $daydiff < 90 ) { // anything between 61 and 89 days is 2 months
$ETA ='2 Months';
}
else
{
$ETA ='';
}