1
0
mirror of https://github.com/php/doc-tr.git synced 2026-03-24 15:22:23 +01:00
Files
archived-doc-tr/reference/wddx/examples.xml
2022-04-06 14:28:59 +03:00

97 lines
2.6 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: 99d758bd259fa80c2828cf8cc250984cb683ee8f Maintainer: nilgun Status: ready -->
<chapter xml:id="wddx.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="wddx.examples-serialize">
<title>WDDX örnekleri</title>
<para>
Değişkenleri dizgeleştiren tüm işlevler, dizinin bir dizi olarak mı yoksa
bir yapı olarak mı dizgeleştirileceğini saptamak için bir dizinin ilk
elemanını kullanır. Eğer ilk eleman dizgesel bir anahtara sahipse bir yapı
olarak aksi takdirde bir dizi olarak dizgeleştirilir.
</para>
<example>
<title>- WDDX ile tek bir değerin dizgeleştirilmesi</title>
<programlisting role="php">
<![CDATA[
<?php
echo wddx_serialize_value("PHP'den WDDX paketi elde etme örneği", "PHP paketi");
?>
]]>
</programlisting>
<para>
Bu örnek şunu üretir:
</para>
<screen>
<![CDATA[
<wddxPacket version='1.0'><header comment='PHP paketi'/><data>
<string>PHP'den WDDX paketi elde etme örneği</string></data></wddxPacket>
]]>
</screen>
</example>
<example>
<title>- WDDX ile artırımsal paketlerin kullanımı</title>
<programlisting role="php">
<![CDATA[
<?php
$pi = 3.1415926;
$packet_id = wddx_packet_start("PHP");
wddx_add_vars($packet_id, "pi");
/* $cities veritabanından geliyor olsun */
$cities = array("Austin", "Novato", "Seattle");
wddx_add_vars($packet_id, "cities");
$packet = wddx_packet_end($packet_id);
echo $packet;
?>
]]>
</programlisting>
<para>
Bu örnek şunu üretir:
</para>
<screen>
<![CDATA[
<wddxPacket version='1.0'><header comment='PHP'/><data><struct>
<var name='pi'><number>3.1415926</number></var><var name='cities'>
<array length='3'><string>Austin</string><string>Novato</string>
<string>Seattle</string></array></var></struct></data></wddxPacket>
]]>
</screen>
</example>
<note>
<para>
Dizgelerin kodlaması UTF-8 olmalıdır. Diğer kodlamalar
<function>mb_convert_encoding</function>, <function>iconv</function> veya
<methodname>UConverter::transcode</methodname> kullanılarak önce UTF-8'e
dönüştürülmelidir.
</para>
</note>
</section>
</chapter>
<!-- 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
-->