title: PHP calculate difference between two dates WITHOUT year
body: <p>I generally use this method to calculate difference between two dates:</p>
  
  <pre><code>$datediff = strtotime($enddate) - strtotime($startdate);        
  $totalDays = floor($datediff/(60*60*24));
  </code></pre>
  
  <p>But now I got a problem. Now I should not consider the year in the calculation. Which means for example the difference between two dates January 2 2014 and January 6 2015 should give me result as 4 days.</p>
  
  <p>For that I changed the date format to <code>m-d</code>, and used the below method:</p>
  
  <pre><code>$startdate = date('m-d',strtotime($startdate));
  $enddate = date('m-d',strtotime($enddate));
  $datediff = $enddate - $startdate;
  $totalDays = floor($datediff/(60*60*24));
  </code></pre>
  
  <p>But I get the result as 0. Can anyone help me? What is the mistake I am doing?</p>