public static function getQueryFromUrl($url, array $additionalParamsToAdd = array())
    {
        $url = @parse_url($url);
        $query = '';

        if (!empty($url['query'])) {
            $query .= $url['query'];
        }

        if (!empty($additionalParamsToAdd)) {
            if (!empty($query)) {
                $query .= '&';
            }

            $query .= Url::getQueryStringFromParameters($additionalParamsToAdd);
        }

        return $query;
    }
public static function getQueryFromUrl($url, array $additionalParamsToAdd = array())
    {
        $url = @parse_url($url);
        $query = '';

        if (!empty($url['query'])) {
            $query .= $url['query'];
        }

        if (!empty($additionalParamsToAdd)) {
            if (!empty($query)) {
                $query .= '&';
            }

            $query .= Url::getQueryStringFromParameters($additionalParamsToAdd);
        }

        return $query;
    }
public static function getQueryFromUrl ( $ url , array $ additionalParamsToAdd = array ( ) ) { $ url = @ parse_url ( $ url ) ; $ query = '' ; if ( ! empty ( $ url [ 'query' ] ) ) { $ query .= $ url [ 'query' ] ; } if ( ! empty ( $ additionalParamsToAdd ) ) { if ( ! empty ( $ query ) ) { $ query .= '&' ; } $ query .= Url :: getQueryStringFromParameters ( $ additionalParamsToAdd ) ; } return $ query ; }
Returns the query part from any valid url and adds additional parameters to the query part if needed.

@param string $url    Any url eg `"http://example.com/piwik/?foo=bar"`
@param array $additionalParamsToAdd    If not empty the given parameters will be added to the query.

@return string eg. `"foo=bar&foo2=bar2"`
@api
Returns the query part from any valid url and adds additional parameters to the query part if needed .