On this page
Requests_Response_Headers::flatten( string|array $value ): string
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
$valuestring|array Required-
Value to flatten
Return
string Flattened value
Source
File: wp-includes/Requests/Response/Headers.php. View all references
public function flatten($value) {
if (is_array($value)) {
$value = implode(',', $value);
}
return $value;
}
Related
Used By
| Used By | Description |
|---|---|
| Requests_Response_Headers::offsetGet() wp-includes/Requests/Response/Headers.php | Get the given header |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests_response_headers/flatten