1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 07:12:18 +01:00
Files
archived-doc-tr/reference/network/functions/http-response-code.xml
Nilgün Belma Bugüner e58913797a New translation
2021-08-02 06:32:35 +03:00

139 lines
3.4 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 0c9c2dd669fe9395eaa73d487fbd160f9057429a Maintainer: nilgun Status: ready -->
<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>HTTP yanıt kodunu tanımlar veya siler</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type class="union"><type>int</type><type>bool</type></type><methodname>http_response_code</methodname>
<methodparam choice="opt"><type>int</type><parameter>yanıt_kodu</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
HTTP yanıt durum kodunu tanımlar veya siler.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>yanıt_kodu</parameter></term>
<listitem>
<para>
Tanımlanacak veya silinecek seçimlik <parameter>yanıt_kodu</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Bir <parameter>yanıt_kodu</parameter> belirtilmişse önceki durum kodu
döner. Belirtilmemişse geçerli durum kodu döner. Bir HTTP sunucusu
ortamında bu değerlerin ikisi de öntanımlı olarak
<literal>200</literal>'dür.
</para>
<para>
<parameter>yanıt_kodu</parameter> belirtilmez ve çağrı HTTP sunucusu
ortamında yapılmazsa (CLI uygulaması ise) &false; döner.
<parameter>yanıt_kodu</parameter> belirtilir ve çağrı HTTP sunucusu
ortamında yapılırsa &true; döner (önceden tanımlanmış bir durum kodu
olmadıkça).
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>- Sunucu ortamında <function>http_response_code</function> kullanımı</title>
<programlisting role="php">
<![CDATA[
<?php
// Geçerli durum kodunu al ve yenisini ata
var_dump(http_response_code(404));
// Yeni durum kodunu al
var_dump(http_response_code());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
int(200)
int(404)
]]>
</screen>
</example>
<example>
<title>- CLI ortamında <function>http_response_code</function> kullanımı</title>
<programlisting role="php">
<![CDATA[
<?php
// Geçerli durum kodunu al ve yenisini ata
var_dump(http_response_code());
// Yeni durum kodunu ata
var_dump(http_response_code(201));
// Yeni durum kodunu al
var_dump(http_response_code());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
bool(true)
int(201)
]]>
</screen>
</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
-->