Aggregate multi-valued parameters by joining the values using a comma
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:
array Returns an array of the combined values
public static function aggregateUsingComma($key, array $value, $encode = false) {
return $encode ? array(
rawurlencode($key) => implode(',', array_map('rawurlencode', $value)),
) : array(
$key => implode(',', $value),
);
}