方法一
$origin = date_create('2009-10-11 21:07:01');
$target = date_create('2009-10-13 08:01:23');
echo $interval = date_diff($origin, $target)->days;
结果为 1 ,不足两天算做1天
方法二
$origin = strtotime('2009-10-11 21:07:01');
$target = strtotime('2009-10-13 08:01:23');
echo ceil(($target-$origin) / 86400);
结果为 2 ,近一取整