如果 MySQL 的日期 = 2013-12-25 & $daydiff = 'any',我正在尝试将我的输出设置为“<em>日期未确认”,如果 MySQL 日期 =“,则输出“<em>不可用” NULL” & 和 $daydiff = '任何'
我的代码
$ArrivalDate = $variants_data['ArrivalDate'];
$daydiff=floor((abs(strtotime(date("Y-m-d")) - strtotime($ArrivalDate))/(60*60*24)));
if ( $daydiff = '' AND $ArrivalDate ='2013-12-25') {
$ETA ='Date Not Confirmed';
}
elseif ( $daydiff = '' AND $ArrivalDate ='NULL') {
$ETA ='Not available';
}
elseif ( $daydiff < '0') {
$ETA ='';
}
elseif ( $daydiff < '31' ) {
$ETA ='Within 30 days';
}
elseif ( $daydiff > '31' ) {
$ETA ='1 Month';
}
elseif ( $daydiff < '60' ) {
$ETA ='2 Months';
}
elseif ( $daydiff < '90' ) {
$ETA ='3 Months';
}
elseif ( $daydiff < '121' ) {
$ETA ='4 Months';
}
elseif ( $daydiff < '152' ) {
$ETA ='5 Months';
}
elseif ( $daydiff < '182' ) {
$ETA ='6 Months';
}
elseif ( $daydiff < '213' ) {
$ETA ='7 Months';
}
elseif ( $daydiff < '245' ) {
$ETA ='8 Months';
}
elseif ( $daydiff < '274' ) {
$ETA ='9 Months';
}
elseif ( $daydiff < '304' ) {
$ETA ='10 Months';
}
elseif ( $daydiff < '334' ) {
$ETA ='11 Months';
}
elseif ( $daydiff < '365' ) {
$ETA ='12 Months';
}
else
{
$ETA ='Not Applicable';
}
到目前为止,代码没有给我所需的结果,我什么时候出错了?