Define the scope of $http_response_header and improved example to reflect the scope. Fix #52582

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@302335 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Richard Quadling 2010-08-16 11:20:33 +00:00
parent 2779e0140a
commit 2907db7cac

View file

@ -14,7 +14,8 @@
<function>get_headers</function> function. When using the
<link linkend="wrappers.http">HTTP wrapper</link>,
<varname>$http_response_header</varname> will be populated with the HTTP
response headers.
response headers. <varname>$http_response_header</varname> will be created
in the <link linkend="language.variables.scope">local scope</link>.
</para>
</refsect1>
@ -26,7 +27,11 @@
<programlisting role="php">
<![CDATA[
<?php
file_get_contents("http://example.com");
function get_contents() {
file_get_contents("http://example.com");
var_dump($http_response_header);
}
get_contents();
var_dump($http_response_header);
?>
]]>
@ -54,6 +59,7 @@ array(9) {
[8]=>
string(38) "Content-Type: text/html; charset=UTF-8"
}
NULL
]]>
</screen>
</example>