$startDateStr = strtotime($startDate); $endtDateStr = strtotime($endDate); $total = $endtDateStr-$startDateStr; //首先将两者转换成时间搓并相减
$time = '剩余'.floor($total/86400).'天'.floor(($total%86400)/3600).'小时'.floor(($total%3600)/60).'分钟'; //这里最大是从天数开始的转换
$startDateStr = strtotime($startDate); $endtDateStr = strtotime($endDate); $total = $endtDateStr-$startDateStr; //首先将两者转换成时间搓并相减
$time = '剩余'.floor($total/86400).'天'.floor(($total%86400)/3600).'小时'.floor(($total%3600)/60).'分钟'; //这里最大是从天数开始的转换