HTTP_PARSE_HEADERS(3) 1 HTTP_PARSE_HEADERS(3)
http_parse_headers - Parse HTTP headers
SYNOPSIS
array http_parse_headers (string $header)
DESCRIPTION
Parses HTTP headers into an associative array.
PARAMETERS
o $header
- string containing HTTP headers
RETURN VALUES
Returns an array on success or FALSE on failure.
EXAMPLES
Example #1
Using http_parse_headers(3)
<?php
$headers = "content-type: text/html; charset=UTF-8
".
"Server: Funky/1.0
".
"Set-Cookie: foo=bar
".
"Set-Cookie: baz=quux
".
"Folded: works
too
";
print_r(http_parse_headers($headers));
?>
The above example will output:
Array
(
[Content-Type] => text/html; charset=UTF-8
[Server] => Funky/1.0
[Set-Cookie] => Array
(
[0] => foo=bar
[1] => baz=quux
)
[Folded] => works
too
)
SEE ALSO
http_parse_message(3), http_parse_cookie(3).
PHP Documentation Group HTTP_PARSE_HEADERS(3)