mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@331329 c90b9560-bf6c-de11-be94-00142212c4b1
74 lines
1.9 KiB
XML
74 lines
1.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: af4410a7e15898c3dbe83d6ea38246745ed9c6fb Maintainer: chuso Status: ready -->
|
|
<!-- Reviewed: yes Maintainer: seros -->
|
|
|
|
<chapter xml:id="intl.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
&reftitle.examples;
|
|
|
|
<section xml:id="intl.examples.basic">
|
|
<title>Uso básico de esta extensión</title>
|
|
<para>
|
|
Cada módulo proporciona dos tipos de APIs: una procedimental y otra orientada a
|
|
objetos. En realidad, ambas son idénticas y están descritas en su correspondiente
|
|
documentación.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Todos los strings de entrada deben estar codificados en UTF-8. Del mismo modo, todos los
|
|
strings de salida deberán estar también en UTF-8.
|
|
</para>
|
|
</note>
|
|
<example>
|
|
<title>Ejemplo usando la API procedimental</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$cotejamiento = collator_create('en_US');
|
|
$resultado = collator_compare($cotejamiento, "string#1", "string#2");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
|
|
<example>
|
|
<title>Ejemplo usando la API orientada a objetos</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$cotejamiento = new Collator('en_US');
|
|
$al = $cotejamiento->getLocale(Locale::ACTUAL_LOCALE);
|
|
echo "Configuración regional real: $al\n";
|
|
|
|
$formateador = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
|
|
echo $formateador->format(1234567);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|
|
|