Requests::flatten( WpOrgRequestsiterable $dictionary )
Convert a key => value array to a ‘key: value’ array for headers
Parameters
- $dictionary
-
(Required) Dictionary of header values
Return
(array) List of headers
Source
File: wp-includes/Requests/src/Requests.php
public static function flatten($dictionary) {
if (InputValidator::is_iterable($dictionary) === false) {
throw InvalidArgument::create(1, '$dictionary', 'iterable', gettype($dictionary));
}
$return = [];
foreach ($dictionary as $key => $value) {
$return[] = sprintf('%s: %s', $key, $value);
}
return $return;
}