src/Uri.php
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));
    }
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));
    }
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 ) ) ; }
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.

@param UriInterface $uri           URI to use as a base.
@param array        $keyValueArray Associative array of key and values

@return UriInterface
Creates a new URI with multiple specific query string values .