public static function QueryString::aggregateUsingDuplicates

Aggregate multi-valued parameters using duplicate values in a query string

Example: http://test.com?q=1&q=2

Parameters

string $key The name of the query string parameter:

array $value The values of the parameter:

bool $encode Set to TRUE to encode field names and values:

Return value

array Returns an array of the combined values

File

drupal/core/vendor/guzzle/http/Guzzle/Http/QueryString.php, line 164

Class

QueryString
Query string object to handle managing query string parameters and aggregating those parameters together as a string.

Namespace

Guzzle\Http

Code

public static function aggregateUsingDuplicates($key, array $value, $encode = false) {
  return $encode ? array(
    rawurlencode($key) => array_map('rawurlencode', $value),
  ) : array(
    $key => $value,
  );
}