public static function getPathAndQueryFromUrl($url)
    {
        $parsedUrl = parse_url($url);
        $result = '';
        if (isset($parsedUrl['path'])) {
            if (substr($parsedUrl['path'], 0, 1) == '/') {
                $parsedUrl['path'] = substr($parsedUrl['path'], 1);
            }
            $result .= $parsedUrl['path'];
        }
        if (isset($parsedUrl['query'])) {
            $result .= '?' . $parsedUrl['query'];
        }
        return $result;
    }
public static function getPathAndQueryFromUrl($url)
    {
        $parsedUrl = parse_url($url);
        $result = '';
        if (isset($parsedUrl['path'])) {
            if (substr($parsedUrl['path'], 0, 1) == '/') {
                $parsedUrl['path'] = substr($parsedUrl['path'], 1);
            }
            $result .= $parsedUrl['path'];
        }
        if (isset($parsedUrl['query'])) {
            $result .= '?' . $parsedUrl['query'];
        }
        return $result;
    }
public static function getPathAndQueryFromUrl ( $ url ) { $ parsedUrl = parse_url ( $ url ) ; $ result = '' ; if ( isset ( $ parsedUrl [ 'path' ] ) ) { if ( substr ( $ parsedUrl [ 'path' ] , 0 , 1 ) == '/' ) { $ parsedUrl [ 'path' ] = substr ( $ parsedUrl [ 'path' ] , 1 ) ; } $ result .= $ parsedUrl [ 'path' ] ; } if ( isset ( $ parsedUrl [ 'query' ] ) ) { $ result .= '?' . $ parsedUrl [ 'query' ] ; } return $ result ; }
Returns the path and query string of a URL.

@param string $url The URL.
@return string eg, `/test/index.php?module=CoreHome` if `$url` is `http://piwik.org/test/index.php?module=CoreHome`.
@api
Returns the path and query string of a URL .