Initial Revision

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@144659 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sara Golemon 2003-11-20 21:25:22 +00:00
parent 3beae10cf9
commit a9c050c6a4

View file

@ -0,0 +1,89 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.headers-list">
<refnamediv>
<refname>headers_list</refname>
<refpurpose>Returns a list of response headers sent (or ready to send)</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>headers_list</methodname>
<void/>
</methodsynopsis>
<simpara>
<function>headers_list</function> will return a numerically indexed array
of headers to be sent to the browser / client. To determine whether or not
these headers have been sent yet, use <function>headers_sent</function>.
</simpara>
<para>
<example>
<title>Examples using <function>headers_list</function></title>
<programlisting role="php">
<![CDATA[
<?php
/* setcookie() will add a response header on its own */
setcookie('foo','bar');
/* Define a custom response header
This will be ignored by most clients */
header("X-Sample-Test: foo");
/* Specify plain text content in our response */
header('Content-type: text/plain');
/* What headers are going to be sent? */
var_dump(headers_list());
/* OUTPUT
======
array(4) {
[0]=>
string(29) "X-Powered-By: PHP/5.0.0"
[1]=>
string(19) "Set-Cookie: foo=bar"
[2]=>
string(18) "X-Sample-Test: foo"
[3]=>
string(24) "Content-type: text/plain"
}
*/
?>
]]>
</programlisting>
</example>
</para>
<simpara>
See Also:
<function>headers_sent</function>,
<function>header</function>, and
<function>setcookie</function>.
</simpara>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->