title: Calculate difference (in hours) between two times in PHP
body: <p>I need to calculate the difference between two times in hours. For example, the difference between 08:00:00 and 09:30:00 would be 1.5 hours.</p>
  
  <p>I'm using the code below:</p>
  
  <pre><code>$time1 = '08:00:00';
  $time2 = '09:30:00';
  $difference = $time2 - $time1;
  echo $difference;
  </code></pre>
  
  <p>Instead of getting 1.5 back as I'd expect, I'm getting 1. I'm sure this is a time formatting issue that someone can easily advise me on. Hopefully... :)</p>