title: How to find out the number of days between two dates
body: <p>i am trying to get number of days between two given dates, but while trying this way its not giving the number of days.</p>
  
  <pre><code>$pur_dt = date_create('2015-08-03');
  
  $todate = date_create(date('Y-m-d'));
  
  $diff = date_diff($todate,$pur_dt);
  print_r($diff);
  echo $diff-&gt;format('%R%a days');
  if($diff&gt;15) //checking condition if $pur_dt - $todate &gt; 15
  {
      echo 'Hello you are not eligible';
  }
  else
  {
      echo 'eligible';
  }
  </code></pre>
  
  <p>its not working, not giving the number of days between given two dates.</p>