hi, using the code found at
http://www.evilwalrus.com/viewcode/181.php
what can I add to tell it to only count files with the prefix "bri_" in the directory?
thanks
count specific files
Moderator: General Moderators
This should work for what ur asking and with simpler code
Code: Select all
print getAllFiles(".");
function getAllFiles ($dir) {
$d = opendir ("$dir");
while ($file = readdir ($d)) {
if (is_dir ($dir."/".$file)) continue; // EDITED THIS MSG: ADDED THIS LINE
if ($file == ".." || $file == ".") continue;
if (preg_match('/^bre_/', $file)) $count++;
}
closedir ($d);
return $count;
}