<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.headers-list.php',
    1 => 'headers_list',
    2 => 'Returns a list of response headers sent (or ready to send)',
  ),
  'up' => 
  array (
    0 => 'ref.network.php',
    1 => 'Функції для мережі',
  ),
  'prev' => 
  array (
    0 => 'function.header-remove.php',
    1 => 'header_remove',
  ),
  'next' => 
  array (
    0 => 'function.headers-sent.php',
    1 => 'headers_sent',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/network/functions/headers-list.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.headers-list" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">headers_list</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">headers_list</span> &mdash; <span class="dc-title">Returns a list of response headers sent (or ready to send)</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.headers-list-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>headers_list</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>headers_list()</strong></span> will return a list of headers to be sent
   to the browser / client.  To determine whether or not these headers have
   been sent yet, use <span class="function"><a href="function.headers-sent.php" class="function">headers_sent()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.headers-list-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">У цієї функції немає
параметрів.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.headers-list-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns a numerically indexed array of headers.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.headers-list-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 Example using <span class="function"><strong>headers_list()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">/* setcookie() will add a response header on its own */<br /></span><span style="color: #0000BB">setcookie</span><span style="color: #007700">(</span><span style="color: #DD0000">'foo'</span><span style="color: #007700">, </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Define a custom response header<br />   This will be ignored by most clients */<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Example-Test: foo"</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Specify plain text content in our response */<br /></span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">'Content-Type: text/plain; charset=UTF-8'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* What headers are going to be sent? */<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">headers_list</span><span style="color: #007700">());<br /><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(3) {
  [0]=&gt;
  string(19) &quot;Set-Cookie: foo=bar&quot;
  [1]=&gt;
  string(17) &quot;Example-Test: foo&quot;
  [2]=&gt;
  string(39) &quot;Content-Type: text/plain; charset=UTF-8&quot;
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.headers-list-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    Заголовки будуть доступні та виводитимуться, тільки якщо використовується
    SAPI, який їх підтримує.
   </p>
  </p></blockquote>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.headers-list-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.headers-sent.php" class="function" rel="rdfs-seeAlso">headers_sent()</a> - Checks if or where headers have been sent</span></li>
    <li><span class="function"><a href="function.header.php" class="function" rel="rdfs-seeAlso">header()</a> - Send a raw HTTP header</span></li>
    <li><span class="function"><a href="function.setcookie.php" class="function" rel="rdfs-seeAlso">setcookie()</a> - Send a cookie</span></li>
    <li><span class="function"><a href="function.apache-response-headers.php" class="function" rel="rdfs-seeAlso">apache_response_headers()</a> - Fetch all HTTP response headers</span></li>
    <li><span class="function"><a href="function.http-response-code.php" class="function" rel="rdfs-seeAlso">http_response_code()</a> - Get or Set the HTTP response code</span></li>
   </ul>
  </p>
 </div>


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