title: Getting last modification date of files in directory using PHP
body: <p>I am trying to get the last modification date of all files in a directory using PHP.</p>
  
  <p>I am using this:</p>
  
  <pre><code>foreach($dir as $file) 
  {
  $mod_date=date("F d Y H:i:s.", filemtime($file));
  }
  </code></pre>
  
  <p><code>foreach($dir as $file)</code> is returning the correct files, but all of the modification dates are coming back as 0000-00-00 00:00:00, instead of the actual modification date.</p>
  
  <p>What changes do I need to make to get this working?</p>