http_parse_headers
http_parse_headers — HTTP ヘッダをパースする
説明
array http_parse_headers ( string header )HTTP ヘッダをパースし、連想配列に格納します。
パラメータ
- header
-
HTTP ヘッダを含む文字列。
返り値
成功した場合に配列、失敗した場合に FALSE を返します。例
例 825. http_parse_headers() の使用法
<?php
$headers = "content-type: text/html; charset=UTF-8\r\n".
"Server: Funky/1.0\r\n".
"Set-Cookie: foo=bar\r\n".
"Set-Cookie: baz=quux\r\n".
"Folded: works\r\n\ttoo\r\n";
print_r(http_parse_headers($headers));
?>
上の例の出力は以下となります。
Array
(
[Content-Type] => text/html; chatset=UTF-8
[Server] => Funky/1.0
[Set-Cookie] => Array
(
[0] => foo=bar
[1] => baz=quux
)
[Folded] => works
too
)
Weblioに収録されているすべての辞書からhttp_parse_headersを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からhttp_parse_headers
を検索
- http_parse_headersのページへのリンク