質問

なぜ私は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;
 }
?>
役に立ちましたか?
scroll top