<?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.header-remove.php',
    1 => 'header_remove',
    2 => '以前に設定したHTTPヘッダを削除する',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'ネットワーク 関数',
  ),
  'prev' => 
  array (
    0 => 'function.header-register-callback.php',
    1 => 'header_register_callback',
  ),
  'next' => 
  array (
    0 => 'function.headers-list.php',
    1 => 'headers_list',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/network/functions/header-remove.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.header-remove" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">header_remove</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">header_remove</span> &mdash; <span class="dc-title">以前に設定したHTTPヘッダを削除する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.header-remove-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>header_remove</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$name</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><a href="function.header.php" class="function">header()</a></span>関数を使って以前に設定したHTTPヘッダを削除します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.header-remove-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">name</code></dt>
     <dd>
      <p class="para">
       削除するヘッダの名前。
       <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> の場合は、以前に設定されたヘッダ全てが削除されます。
      </p>
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <span class="simpara">
        このパラメータは大文字小文字を区別しません
       </span>
      </p></blockquote>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.header-remove-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   値を返しません。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.header-remove-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">name</code> は、nullable になりました。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.header-remove-examples">
  <h3 class="title">例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>例1 特定のヘッダを削除する</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">"X-Foo: Bar"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"X-Bar: Baz"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header_remove</span><span style="color: #007700">(</span><span style="color: #DD0000">"X-Foo"</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">X-Bar: Baz</pre>
</div>
    </div>
   </div>
   <div class="example" id="example-2">
    <p><strong>例2 以前設定したすべてヘッダを削除する</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />header</span><span style="color: #007700">(</span><span style="color: #DD0000">"X-Foo: Bar"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"X-Bar: Baz"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">header_remove</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"></pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.header-remove-notes">
  <h3 class="title">注意</h3>
  <div class="caution"><strong class="caution">警告</strong>
   <p class="para">
    この関数はPHPが設定した <em>すべての</em> ヘッダを削除します。
    削除されるヘッダには、cookie や セッション、<code class="literal">X-Powered-By</code> があります。
   </p>
  </div>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    ヘッダにアクセスできたりヘッダを出力したりするのは、
    それに対応した SAPI を使っている場合のみです。
   </p>
  </p></blockquote>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.header-remove-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.header.php" class="function" rel="rdfs-seeAlso">header()</a> - 生の HTTP ヘッダを送信する</span></li>
    <li><span class="function"><a href="function.headers-sent.php" class="function" rel="rdfs-seeAlso">headers_sent()</a> - ヘッダが既に送信されているかどうかを調べる</span></li>
   </ul>
  </p>
 </div>


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