Copied!
CloneableFinalInstantiable
Methods
public static build(array $params, $encoding = 2GuzzleHttp\Psr7\PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true) : string
 

Build a query string from an array of key value pairs.

This function can use the return value of parse() to build a query string. This function does not modify the provided keys when an array is encountered (like http_build_query() would).

  • param array $params Query string parameters.
  • param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 to encode using RFC3986, or PHP_QUERY_RFC1738 to encode using RFC1738.
  • param bool $treatBoolsAsInts Set to true to encode as 0/1, and false as false/true.
public static parse(string $str, $urlEncoding = true) : array
 

Parse a query string into an associative array.

If multiple values are found for the same key, the value of that key value pair will become an array. This function does not parse nested PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).

  • param string $str Query string to parse
  • param int|bool $urlEncoding How the query string is encoded
Methods
public static build(array $params, $encoding = 2GuzzleHttp\Psr7\PHP_QUERY_RFC3986, bool $treatBoolsAsInts = true) : string
 

Build a query string from an array of key value pairs.

This function can use the return value of parse() to build a query string. This function does not modify the provided keys when an array is encountered (like http_build_query() would).

  • param array $params Query string parameters.
  • param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 to encode using RFC3986, or PHP_QUERY_RFC1738 to encode using RFC1738.
  • param bool $treatBoolsAsInts Set to true to encode as 0/1, and false as false/true.
public static parse(string $str, $urlEncoding = true) : array
 

Parse a query string into an associative array.

If multiple values are found for the same key, the value of that key value pair will become an array. This function does not parse nested PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).

  • param string $str Query string to parse
  • param int|bool $urlEncoding How the query string is encoded
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration