title: PHP convert date interval diff to decimal
body: <p>I'm trying to convert the difference between two dates into a total year count, right now I'm using this:</p>
  
  <pre><code> $datetime1 = new DateTime('2009-10-11'); 
   $datetime2 = new DateTime('2010-10-10');
   $interval = $datetime1-&gt;diff($datetime2);
   return $interval-&gt;format('%y');
  </code></pre>
  
  <p>This returns me an int (Like 0 for &lt; than a year, 2 for two years, etc.)</p>
  
  <p>I need the result to be decimal as following:</p>
  
  <p>0.9 - 9 months</p>
  
  <p>1.2 - 1 year and two months</p>
  
  <p>3.5 - 3 years and five months </p>
  
  <p>and so on..</p>
  
  <p>Thanks!</p>