<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.network.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.http-get-last-response-headers.php',
    1 => 'http_get_last_response_headers',
    2 => '最後の HTTP レスポンスヘッダーを取得します',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'ネットワーク 関数',
  ),
  'prev' => 
  array (
    0 => 'function.http-clear-last-response-headers.php',
    1 => 'http_clear_last_response_headers',
  ),
  'next' => 
  array (
    0 => 'function.http-response-code.php',
    1 => 'http_response_code',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/network/functions/http-get-last-response-headers.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.http-get-last-response-headers" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">http_get_last_response_headers</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">http_get_last_response_headers</span> &mdash; <span class="dc-title">最後の HTTP レスポンスヘッダーを取得します</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.http-get-last-response-headers-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>http_get_last_response_headers</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.array.php" class="type array">array</a></span></span></div>

  <p class="simpara">
   <a href="wrappers.http.php" class="link">HTTP ラッパー</a> を介して受け取った最後の <abbr title="Hypertext Transfer Protocol">HTTP</abbr> レスポンスヘッダーを含む
   <span class="type"><a href="language.types.array.php" class="type array">array</a></span> を返します。
   レスポンスヘッダーがない場合は、 <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.http-get-last-response-headers-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">この関数にはパラメータはありません。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.http-get-last-response-headers-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   <a href="wrappers.http.php" class="link">HTTP ラッパー</a> を使って受け取った <abbr title="Hypertext Transfer Protocol">HTTP</abbr> ヘッダーを
   インデックス付きの <span class="type"><a href="language.types.array.php" class="type array">array</a></span> で返します。
   ヘッダーがない場合は、 <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.http-get-last-response-headers-examples">
  <h3 class="title">例</h3>
  <div class="example" id="function.http-get-last-response-headers.example.basic">
   <p><strong>例1 <span class="function"><strong>http_get_last_response_headers()</strong></span> example</strong></p>
   <div class="example-contents"><p>
    Description.
   </p></div>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />file_get_contents</span><span style="color: #007700">(</span><span style="color: #DD0000">"http://example.com"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">http_get_last_response_headers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>上の例の出力は、
たとえば以下のようになります。</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(14) {
  [0]=&gt;
  string(15) &quot;HTTP/1.1 200 OK&quot;
  [1]=&gt;
  string(20) &quot;Accept-Ranges: bytes&quot;
  [2]=&gt;
  string(11) &quot;Age: 326940&quot;
  [3]=&gt;
  string(29) &quot;Cache-Control: max-age=604800&quot;
  [4]=&gt;
  string(38) &quot;Content-Type: text/html; charset=UTF-8&quot;
  [5]=&gt;
  string(35) &quot;Date: Mon, 11 Nov 2024 13:34:09 GMT&quot;
  [6]=&gt;
  string(23) &quot;Etag: &quot;3147526947+gzip&quot;&quot;
  [7]=&gt;
  string(38) &quot;Expires: Mon, 18 Nov 2024 13:34:09 GMT&quot;
  [8]=&gt;
  string(44) &quot;Last-Modified: Thu, 17 Oct 2019 07:18:26 GMT&quot;
  [9]=&gt;
  string(24) &quot;Server: ECAcc (nyd/D16C)&quot;
  [10]=&gt;
  string(21) &quot;Vary: Accept-Encoding&quot;
  [11]=&gt;
  string(12) &quot;X-Cache: HIT&quot;
  [12]=&gt;
  string(20) &quot;Content-Length: 1256&quot;
  [13]=&gt;
  string(17) &quot;Connection: close&quot;
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.http-get-last-response-headers-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.http-clear-last-response-headers.php" class="function" rel="rdfs-seeAlso">http_clear_last_response_headers()</a> - 保存された HTTP レスポンスヘッダーをクリア</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>