title: Ignore hidden files with php
body: <p>I am trying to scan a folder of images, however I keep seeing the ._ files the mac created</p>
  
  <p>I am using this code:</p>
  
  <pre><code>   &lt;?php
  if ($handle = opendir('assets/automotive')) {
      $ignore = array( 'cgi-bin', '.', '..','._' );
      while (false !== ($file = readdir($handle))) {
          if ( !in_array($file,$ignore)) {
              echo "$file\n";
          }
      }
      closedir($handle);
  }
  ?&gt;
  </code></pre>
  
  <p>Any ideas as to why? I created a ignore array that covers it. </p>
  
  <p><strong>Update: Still shows both.</strong></p>