You are here

public static function Uri::withQueryValues in Auth0 Single Sign On 8.2

Creates a new URI with multiple specific query string values.

It has the same behavior as withQueryValue() but for an associative array of key => value.

Parameters

UriInterface $uri URI to use as a base.:

array $keyValueArray Associative array of key and values:

Return value

UriInterface

File

vendor/guzzlehttp/psr7/src/Uri.php, line 343

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

public static function withQueryValues(UriInterface $uri, array $keyValueArray) {
  $result = self::getFilteredQueryString($uri, array_keys($keyValueArray));
  foreach ($keyValueArray as $key => $value) {
    $result[] = self::generateQueryString($key, $value);
  }
  return $uri
    ->withQuery(implode('&', $result));
}