WpOrg\Requests
Requests::flatten
Convert a key => value array to a 'key: value' array for headers
Метод класса: Requests{}
Хуков нет.
Возвращает
Массив. List of headers
Использование
$result = Requests::flatten( $dictionary );
- $dictionary(iterable) (обязательный)
- Dictionary of header values.
Код Requests::flatten() Requests::flatten WP 6.8.3
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;
}