public static function getPathSegments(array $exclude = array()): array
    {
        $exclude = array_merge($exclude, array(
            INDEX_FILE,
            CHAR_SPACE,
            ''
        ));
        
        $exclude[] = "";
        
        $requestUri = self::getServerVariable('REQUEST_URI', '');
        $requestUri = substr($requestUri, 0, (strpos($requestUri, "?") !== false) ? strpos($requestUri, "?") : strlen($requestUri));
        $requestUri = preg_replace("#/+#", "/", $requestUri);
        
        $pathInfo = explode(CHAR_SLASH, $requestUri);
        return array_values(array_diff(array_merge($pathInfo, $exclude), $exclude));
    }
public static function getPathSegments(array $exclude = array()): array
    {
        $exclude = array_merge($exclude, array(
            INDEX_FILE,
            CHAR_SPACE,
            ''
        ));
        
        $exclude[] = "";
        
        $requestUri = self::getServerVariable('REQUEST_URI', '');
        $requestUri = substr($requestUri, 0, (strpos($requestUri, "?") !== false) ? strpos($requestUri, "?") : strlen($requestUri));
        $requestUri = preg_replace("#/+#", "/", $requestUri);
        
        $pathInfo = explode(CHAR_SLASH, $requestUri);
        return array_values(array_diff(array_merge($pathInfo, $exclude), $exclude));
    }
public static function getPathSegments ( array $ exclude = array ( ) ) : array { $ exclude = array_merge ( $ exclude , array ( INDEX_FILE , CHAR_SPACE , '' ) ) ; $ exclude [ ] = "" ; $ requestUri = self :: getServerVariable ( 'REQUEST_URI' , '' ) ; $ requestUri = substr ( $ requestUri , 0 , ( strpos ( $ requestUri , "?" ) !== false ) ? strpos ( $ requestUri , "?" ) : strlen ( $ requestUri ) ) ; $ requestUri = preg_replace ( "#/+#" , "/" , $ requestUri ) ; $ pathInfo = explode ( CHAR_SLASH , $ requestUri ) ; return array_values ( array_diff ( array_merge ( $ pathInfo , $ exclude ) , $ exclude ) ) ; }
Get path segments from the request-path as array.

@param array $exclude
Segments to exclude from the returned values.

@return array Path segments from the request-path as array
Get path segments from the request - path as array .