PHP求两个日期相差的天数

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<?php
function maketime($date)
{
	list($year,$month,$day) = explode("-",$date);
	return mktime(0,0,0,$month,$day,$year);
}

$date1 = "2015-01-01";
$date2 = "2015-01-05";
$d = (maketime($date2) - maketime($date1)) / (3600*24);
echo "$date1 - $date2<br /> 相差 $d 天";
?>