Source of: /manual/en/reserved.variables.httpresponseheader.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reserved.variables.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'reserved.variables.httpresponseheader.php',
1 => '$http_response_header',
),
'up' =>
array (
0 => 'reserved.variables.php',
1 => 'Predefined Variables',
),
'prev' =>
array (
0 => 'reserved.variables.httprawpostdata.php',
1 => '$HTTP_RAW_POST_DATA',
),
'next' =>
array (
0 => 'reserved.variables.argc.php',
1 => '$argc',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div id="reserved.variables.httpresponseheader" class="refentry">
<div class="refnamediv">
<h1 class="refname">$http_response_header</h1>
<p class="refpurpose"><span class="refname">$http_response_header</span> — <span class="dc-title">HTTP response headers</span></p>
</div>
<a name="reserved.variables.httpresponseheader.description"></a><div class="refsect1 description">
<h3 class="title">Description</h3>
<p class="para">
The <var class="varname">$http_response_header</var> <a href="language.types.array.php" class="type array">array</a> is similar to the
<a href="function.get-headers.php" class="function">get_headers()</a> function. When using the
<a href="wrappers.http.php" class="link">HTTP wrapper</a>,
<var class="varname">$http_response_header</var> will be populated with the HTTP
response headers.
</p>
</div>
<a name="reserved.variables.httpresponseheader.examples"></a><div class="refsect1 examples">
<h3 class="title">Examples</h3>
<p class="para">
</p><div class="example">
<p><b>Example #1 <var class="varname">$http_response_header</var> example</b></p>
<div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?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_response_header</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
<div class="example-contents para"><p>The above example will output
something similar to:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
array(9) {
[0]=>
string(15) "HTTP/1.1 200 OK"
[1]=>
string(35) "Date: Sat, 12 Apr 2008 17:30:38 GMT"
[2]=>
string(29) "Server: Apache/2.2.3 (CentOS)"
[3]=>
string(44) "Last-Modified: Tue, 15 Nov 2005 13:24:10 GMT"
[4]=>
string(27) "ETag: "280100-1b6-80bfd280""
[5]=>
string(20) "Accept-Ranges: bytes"
[6]=>
string(19) "Content-Length: 438"
[7]=>
string(17) "Connection: close"
[8]=>
string(38) "Content-Type: text/html; charset=UTF-8"
}
</pre></div>
</div>
</div><p>
</p>
</div>
</div><?php manual_footer(); ?>