W3cubDocs

/WordPress

Requests::flatten( array $array )

Convert a key => value array to a ‘key: value’ array for headers

Parameters

$array

(array) (Required) Dictionary of header values

Return

(string[]) List of headers

Source

File: wp-includes/class-requests.php

public static function flatten($array) {
		$return = array();
		foreach ($array as $key => $value) {
			$return[] = sprintf('%s: %s', $key, $value);
		}
		return $return;
	}

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/requests/flatten