Requests::flatten

Advertisement

Summery Summery

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

Syntax Syntax

Requests::flatten( array $array )

Parameters Parameters

$array

(Required) Dictionary of header values

Return Return

(string[]) List of headers

Source Source

File: wp-includes/class-requests.php

	 * @return string[] List of headers
	 */
	public static function flatten($array) {
		$return = array();
		foreach ($array as $key => $value) {
			$return[] = sprintf('%s: %s', $key, $value);
		}

Advertisement

Advertisement

Leave a Reply