On this page
Requests::flatten( array $array ): array
Convert a key => value array to a ‘key: value’ array for headers
Parameters
$arrayarray Required-
Dictionary of header values
Return
array List of headers
Source
File: wp-includes/class-requests.php. View all references
public static function flatten($array) {
$return = array();
foreach ($array as $key => $value) {
$return[] = sprintf('%s: %s', $key, $value);
}
return $return;
}
Related
Used By
| Used By | Description |
|---|---|
| Requests::flattern() wp-includes/class-requests.php | Convert a key => value array to a ‘key: value’ array for headers |
| Requests_Transport_cURL::setup_handle() wp-includes/Requests/Transport/cURL.php | Setup the cURL handle for the given data |
| Requests_Transport_fsockopen::request() wp-includes/Requests/Transport/fsockopen.php | Perform a request |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests/flatten