Requests_Response_Headers::flatten()publicWP 1.0

Flattens a value into a string

Converts an array into a string by imploding values with a comma, as per RFC2616's rules for folding headers.

{} It's a method of the class: Requests_Response_Headers{}

No Hooks.


String. Flattened value


$Requests_Response_Headers = new Requests_Response_Headers();
$Requests_Response_Headers->flatten( $value );
$value(string|array) (required)
Value to flatten

Code of Requests_Response_Headers::flatten() WP 6.0

public function flatten($value) {
	if (is_array($value)) {
		$value = implode(',', $value);

	return $value;