public static function getFirstLevelDirs($dir)
    {
        $iterator = new DirectoryIterator($dir);
        $result = array();

        foreach ($iterator as $item) {
            if (!$item->isDot() && $item->isDir()) {
                array_push($result, $item->getFileName());
            }
        }

        return $result;
    }
public static function getFirstLevelDirs($dir)
    {
        $iterator = new DirectoryIterator($dir);
        $result = array();

        foreach ($iterator as $item) {
            if (!$item->isDot() && $item->isDir()) {
                array_push($result, $item->getFileName());
            }
        }

        return $result;
    }
public static function getFirstLevelDirs ( $ dir ) { $ iterator = new DirectoryIterator ( $ dir ) ; $ result = array ( ) ; foreach ( $ iterator as $ item ) { if ( ! $ item -> isDot ( ) && $ item -> isDir ( ) ) { array_push ( $ result , $ item -> getFileName ( ) ) ; } } return $ result ; }
Returns nested directories inside provided one

@param string $dir
@throws \UnexpectedValueException If can't open a directory
@return array
Returns nested directories inside provided one