Source of: /manual/en/function.getallheaders.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.apache.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'function.getallheaders.php',
1 => 'getallheaders',
),
'up' =>
array (
0 => 'ref.apache.php',
1 => 'Apache Functions',
),
'prev' =>
array (
0 => 'function.ebcdic2ascii.php',
1 => 'ebcdic2ascii',
),
'next' =>
array (
0 => 'function.virtual.php',
1 => 'virtual',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="function.getallheaders" class="refentry">
<div class="refnamediv">
<h1 class="refname">getallheaders</h1>
<p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">getallheaders</span> — <span class="dc-title">Fetch all HTTP request headers</span></p>
</div>
<a name="function.getallheaders.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">array</span> <span class="methodname"><b>getallheaders</b></span>
( <span class="methodparam">void</span>
)</div>
<p class="para rdfs-comment">
Fetches all HTTP headers from the current request.
</p>
<p class="para">
This function is an alias for <a href="function.apache-request-headers.php" class="function">apache_request_headers()</a>.
Please read the <a href="function.apache-request-headers.php" class="function">apache_request_headers()</a>
documentation for more information on how this function works.
</p>
<p class="simpara">This function is only supported when PHP
is installed as an Apache module.</p>
</div>
<a name="function.getallheaders.returnvalues"></a><div class="refsect1 returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
An associative array of all the HTTP headers in the current request, or
<b><tt class="constant">FALSE</tt></b> on failure.
</p>
</div>
<a name="function.getallheaders.changelog"></a><div class="refsect1 changelog">
<h3 class="title">Changelog</h3>
<p class="para">
</p><table class="doctable informaltable">
<thead valign="middle">
<tr valign="middle">
<th>Version</th>
<th>Description</th>
</tr>
</thead>
<tbody valign="middle" class="tbody">
<tr valign="middle">
<td align="left">4.3.0</td>
<td align="left">
Became an alias for <a href="function.apache-request-headers.php" class="function">apache_request_headers()</a>.
Essentially, it was renamed. This is because this function
only works with Apache.
</td>
</tr>
</tbody>
</table>
<p>
</p>
</div>
<a name="function.getallheaders.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <b>getallheaders()</b> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">getallheaders</span><span style="color: #007700">() as </span><span style="color: #0000BB">$name </span><span style="color: #007700">=> </span><span style="color: #0000BB">$value</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$name</span><span style="color: #DD0000">: </span><span style="color: #0000BB">$value</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div><p>
</p>
</div>
<a name="function.getallheaders.notes"></a><div class="refsect1 notes">
<h3 class="title">Notes</h3>
<blockquote><p><b class="note">Note</b>: As of PHP 4.3.3 you can use this function with the
<a href="ref.nsapi.php" class="link">NSAPI server module</a> in Netscape/iPlanet/SunONE
webservers, too.<br /></p></blockquote>
</div>
<a name="function.getallheaders.seealso"></a><div class="refsect1 seealso">
<h3 class="title">See Also</h3>
<p class="para">
</p><ul class="simplelist">
<li class="member"><a href="function.apache-response-headers.php" class="function" rel="rdfs-seeAlso">apache_response_headers()</a> - Fetch all HTTP response headers</li>
</ul><p>
</p>
</div>
</div><?php manual_footer(); ?>