title: use regex with array_diff() to exclude files with given extension
body: <p>I echo out a directory's contents, excluding some files like this:</p>
  
  <pre><code>$exclude_list = array(".", "..", "index.php",".htaccess");
  $scanned_directory = array_diff(scandir($dir), $exclude_list);   
  </code></pre>
  
  <p>I would like to add all the files in the directory with the extension <code>.meta.js</code> to the exclude list. Can I do that with a regex, or would I have to loop through them and add them to the array individually, or is there some other way?</p>