original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Returns the path and query string of a URL .