$days = round((strtotime('2020-02-29')-strtotime('2020-02-28'))/3600/24); 以上代码可以计算出相差一天。PHP计算两个时间相差天数