original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Returns the query part from any valid url and adds additional parameters to the query part if needed .