public function getFirstDir($path) { $files = scandir($path); if (!$files) { return false; } foreach ($files as $file) { if ($file != '.' && $file != '..' && is_dir($path . '/' . $file)) { return $file; } } }