mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@146503 c90b9560-bf6c-de11-be94-00142212c4b1
90 lines
2.1 KiB
XML
90 lines
2.1 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.3 $ -->
|
|
<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());
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
this will output :
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
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"
|
|
}
|
|
|
|
]]>
|
|
</screen>
|
|
</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
|
|
-->
|