Revision: 34766
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at October 28, 2010 02:59 by mattkenefick
Initial Code
function match_files_in_directory($dir, $extension = '.jpg'){
$ary = array();
if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." && strpos($file, $extension) > -1 ) {
$ary[] = $file;
}
}
closedir($handle);
}
return $ary;
}
Initial URL
Initial Description
Returns an array of files that match a search term in a certain directory.
Initial Title
match_files_in_directory
Initial Tags
files, directory
Initial Language
PHP