为什么在这些日期之间我得到5,9 ....如果我再使用另一年我得到6 ????它只发生在3月和2008年...为什么会有一个小时的差异?
<?php
$from = '2008-03-04';
$to = '2008-03-10';
echo datediff($from,$to);
$from = '2010-03-04';
$to = '2010-03-10';
echo datediff($from,$to);
function datediff($from,$to)
{
$diff = strtotime($to) - strtotime($from);
$diff = $diff/(60*60*24);
return $diff;
}
?>