title: Finding the number of days between two dates which is stored in m/d/Y format
body: <p>I want to calculate <code>expiry date</code> percentage.But my <code>starting date</code> and <code>expirydate</code> are in <code>m/d/Y</code> format.How I will find the number of days between <code>starting date</code> and <code>ending date</code>???This is my code...</p>
  
  <pre><code> foreach ($result['query'] as $row) {
              $validitystart = $row-&gt;validitystart;
              $expirydate = $row-&gt;expirydate;
              $today = date('m/d/Y');
              $maxdiff = date_diff($expirydate, $validitystart);
              $diff = date_diff($expirydate, $today);
              $percentage = ($diff * 100) / $maxdiff;
          }
  </code></pre>