title: Get a PHP DateTime difference in days, considering midnight as a day change
body: <p>What is the simplest way to get the difference in days between two PHP <code>DateTimes</code>, considering midnight as a day change (just like the <code>DATEDIFF(DAY)</code> SQL function does)?</p>
  
  <p>For example, between today at 13:00 and tomorrow at 12:00, I should get 1 (day), even though the interval is less than 24 hours.</p>
  
  <pre><code>$date1 = new DateTime("2013-08-07 13:00:00");
  $date2 = new DateTime("2013-08-08 12:00:00");
  echo $date1-&gt;diff($date2)-&gt;days; // 0
  </code></pre>