mirror of
https://github.com/php/doc-ru.git
synced 2026-03-25 16:22:18 +01:00
118 lines
3.2 KiB
XML
118 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: eecf09080681d1e242b9dc1b8a8148eda66141f8 Maintainer: bfl Status: ready -->
|
||
<!-- Reviewed: no -->
|
||
|
||
<refentry xml:id="function.headers-list" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>headers_list</refname>
|
||
<refpurpose>Возвращает список переданных заголовков (или готовых к отправке)</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>array</type><methodname>headers_list</methodname>
|
||
<void/>
|
||
</methodsynopsis>
|
||
<para>
|
||
Функция <function>headers_list</function> возвращает список заголовков,
|
||
передаваемых браузеру / клиенту. Для того, чтобы определить переданы ли уже
|
||
заголовки, используйте функцию <function>headers_sent</function>.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
&no.function.parameters;
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
Возвращает нумерованный массив заголовков.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>Пример использования <function>headers_list</function></title>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
|
||
/* Функция setcookie() добавит заголовок сама по себе */
|
||
setcookie('foo', 'bar');
|
||
|
||
/* Определение пользовательского заголовка
|
||
Это будет проигнорировано большинством клиентов */
|
||
header("Example-Test: foo");
|
||
|
||
/* Передача простого текстового контента */
|
||
header('Content-Type: text/plain; charset=UTF-8');
|
||
|
||
/* Какие заголовки будут отправлены? */
|
||
var_dump(headers_list());
|
||
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
&example.outputs.similar;
|
||
<screen>
|
||
<![CDATA[
|
||
array(3) {
|
||
[0]=>
|
||
string(19) "Set-Cookie: foo=bar"
|
||
[1]=>
|
||
string(17) "Example-Test: foo"
|
||
[2]=>
|
||
string(39) "Content-Type: text/plain; charset=UTF-8"
|
||
}
|
||
|
||
]]>
|
||
</screen>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="notes">
|
||
&reftitle.notes;
|
||
¬e.network.header.sapi;
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>headers_sent</function></member>
|
||
<member><function>header</function></member>
|
||
<member><function>setcookie</function></member>
|
||
<member><function>apache_response_headers</function></member>
|
||
<member><function>http_response_code</function></member>
|
||
</simplelist>
|
||
</para>
|
||
</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:"~/.phpdoc/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
|
||
-->
|