function imce_get_subdirectories in IMCE 6
Scan directory and return directories matching the expression.
1 call to imce_get_subdirectories()
- imce_create_subdirectories in inc/
subdir.inc - Create directories under root according to path.
File
- inc/
subdir.inc, line 78
Code
function imce_get_subdirectories($dir, $expr = '') {
$directories = array();
if ($handle = @opendir($dir)) {
while (($file = readdir($handle)) !== FALSE) {
if ($file != '.' && $file != '..' && is_dir($dir . '/' . $file) && preg_match('/^' . $expr . '$/', $file)) {
$directories[] = $dir . '/' . $file;
}
}
closedir($handle);
}
return $directories;
}