public static function QueryString::aggregateUsingComma

Aggregate multi-valued parameters by joining the values using a comma

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 146

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 aggregateUsingComma($key, array $value, $encode = false) {
  return $encode ? array(
    rawurlencode($key) => implode(',', array_map('rawurlencode', $value)),
  ) : array(
    $key => implode(',', $value),
  );
}