You are here

function Net_URL::getQueryString in Flickr API 5

Returns flat querystring

@access public

Return value

string Querystring

1 call to Net_URL::getQueryString()
Net_URL::getURL in phpFlickr/PEAR/Net/URL.php
Returns full url

File

phpFlickr/PEAR/Net/URL.php, line 271

Class

Net_URL

Code

function getQueryString() {
  if (!empty($this->querystring)) {
    foreach ($this->querystring as $name => $value) {
      if (is_array($value)) {
        foreach ($value as $k => $v) {
          $querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : $name . '=' . $v;
        }
      }
      elseif (!is_null($value)) {
        $querystring[] = $name . '=' . $value;
      }
      else {
        $querystring[] = $name;
      }
    }
    $querystring = implode(ini_get('arg_separator.output'), $querystring);
  }
  else {
    $querystring = '';
  }
  return $querystring;
}