I echo out a directory's contents, excluding some files like this:
$exclude_list = array(".", "..", "index.php",".htaccess");
$scanned_directory = array_diff(scandir($dir), $exclude_list);
I would like to add all the files in the directory with the extension .meta.js
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?