Flattens a value into a string
Description
Converts an array into a string by imploding values with a comma, as per RFC2616’s rules for folding headers.
Parameters
$value
string|arrayrequired- Value to flatten
Source
public function flatten($value) {
if (is_string($value)) {
return $value;
}
if (is_array($value)) {
return implode(',', $value);
}
throw InvalidArgument::create(1, '$value', 'string|array', gettype($value));
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.