mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-28 03:03:19 +02:00
e86283aabd
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@316944 c90b9560-bf6c-de11-be94-00142212c4b1
116 lines
2.8 KiB
XML
116 lines
2.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 3a29c12dc213a208e868ba1d1a7b8530e90ab5f3 Maintainer: jpauli Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xml:id="function.http-response-code" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>http_response_code</refname>
|
|
<refpurpose>Récupère ou change le code de la réponse HTTP</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>int</type><methodname>http_response_code</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>response_code</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Si vous ne passez pas de paramètre, http_response_code retourne le code courant.
|
|
Si vous passez un paramètre, elle change alors le code de la réponse HTTP.
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>response_code</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le paramètre optionnel <parameter>response_code</parameter> change le code de la réponse.
|
|
</para>
|
|
<para>
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
http_response_code(404);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Le code de la réponse courant. Par défaut int(200).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemples avec <function>headers_list</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
// Récupère le code courant de la réponse
|
|
var_dump(http_response_code()); // int(200)
|
|
|
|
// Change le code de la réponse
|
|
http_response_code(404);
|
|
|
|
// Récupère notre nouveau code de réponse
|
|
var_dump(http_response_code()); // int(404)
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>header</function></member>
|
|
<member><function>headers_list</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
|
|
-->
|