function scandir($dir) { foreach (scandir($dir) as $path) { if (0 !== strpos($path, '.') && is_dir($dir . '/' . $path)) { $this->matched_dirs[] = $dir . '/' . $path; $this->scandir($dir . '/' . $path); } } }