Requests_Response_Headers::flatten() WordPress Method
The flatten() method of the Requests_Response_Headers class takes an array of headers and returns a single string containing the headers, separated by newlines. This is useful for displaying headers in a human-readable format.
Requests_Response_Headers::flatten( string|array $value ) #
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|array)(Required)Value to flatten
Return
(string) Flattened value
Source
File: wp-includes/Requests/Response/Headers.php
public function flatten($value) { if (is_array($value)) { $value = implode(',', $value); } return $value; }
Expand full source codeCollapse full source codeView on TracView on GitHub