public static function getFilePath($cwd, array $index)
    {
        $path = self::getRequestPath();

        if ($path === false) {
            return false;
        }

        $file = $cwd.$path;

        if (is_file($file)) {
            return $file;
        }

        if (empty($index)) {
            return false;
        }

        foreach ($index as $ext) {
            $f = rtrim($file, '/').'/index.'.$ext;

            if (is_file($f)) {
                return $f;
            }
        }

        return false;
    }
public static function getFilePath($cwd, array $index)
    {
        $path = self::getRequestPath();

        if ($path === false) {
            return false;
        }

        $file = $cwd.$path;

        if (is_file($file)) {
            return $file;
        }

        if (empty($index)) {
            return false;
        }

        foreach ($index as $ext) {
            $f = rtrim($file, '/').'/index.'.$ext;

            if (is_file($f)) {
                return $f;
            }
        }

        return false;
    }
public static function getFilePath ( $ cwd , array $ index ) { $ path = self :: getRequestPath ( ) ; if ( $ path === false ) { return false ; } $ file = $ cwd . $ path ; if ( is_file ( $ file ) ) { return $ file ; } if ( empty ( $ index ) ) { return false ; } foreach ( $ index as $ ext ) { $ f = rtrim ( $ file , '/' ) . '/index.' . $ ext ; if ( is_file ( $ f ) ) { return $ f ; } } return false ; }
Check whether the requested path exists

@param string $cwd
@param array $index

@return string|false
Check whether the requested path exists