http_parse_headersとは? わかりやすく解説

Weblio 辞書 > コンピュータ > PHP関数リファレンス > http_parse_headersの意味・解説 

http_parse_headers

(PECL)
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のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
PHP Documentation GroupPHP Documentation Group
Copyright © 1997 - 2025 by the PHP Documentation Group.

©2025 GRAS Group, Inc.RSS