计算两个日期相差的天数,原理:
将两个日期转成时间戳格式,然后求出相差秒数,再除60 除60 除24
既得出天数!
http://www.timebag.net/117.html
<?
$T1= mktime(10,20,30,2,5,2000); //2000-2-5 10:20:30
$T2 = mktime(18,30,20,5,2,2000); //2000-5-2 18:30:20
$day= (int)(($time2-$time1)/(24*3600));
echo "$T1和 $T2的时间差为:" . $day. "天<br>";
?>