1
0
mirror of https://github.com/php/doc-it.git synced 2026-03-24 15:42:46 +01:00
Files
Richard Quadling 2769b12f1b Reencode XML to UTF-8
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@314558 c90b9560-bf6c-de11-be94-00142212c4b1
2011-08-08 16:37:53 +00:00

103 lines
3.2 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- EN-Revision: n/a Maintainer: darvina Status: ready -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry xml:id="function.strtr" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>strtr</refname>
<refpurpose>Traduce certi caratteri</refpurpose>
</refnamediv>
<refsect1>
<title>Descrizione</title>
<methodsynopsis>
<type>string</type><methodname>strtr</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam><type>string</type><parameter>from</parameter></methodparam>
<methodparam><type>string</type><parameter>to</parameter></methodparam>
</methodsynopsis>
<methodsynopsis>
<type>string</type><methodname>strtr</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam><type>array</type><parameter>replace_pairs</parameter></methodparam>
</methodsynopsis>
<para>
Questa funzione restituisce una copia di <parameter>str</parameter>,
traducendo tutti i caratteri di
<parameter>from</parameter> al corrispondente carattere indicato in
<parameter>to</parameter>.
</para>
<para>
Se <parameter>from</parameter> e <parameter>to</parameter> hanno
lunghezze differenti, i caratteri in più presenti nella stringa più lunga
saranno ignorati.
<example>
<title>Esempio di uso di <function>strtr</function></title>
<programlisting role="php">
<![CDATA[
<?php
$addr = strtr($addr, "äåö", "aao");
?>
]]>
</programlisting>
</example>
</para>
<para>
<function>strtr</function> può essere eseguita con solo due argomenti.
Se viene chiamata con due parametri si comporta in modo nuovo:
<parameter>from</parameter> deve essere un matrice che contiene le coppie
stringa -> stringa da sostituire nella stringa sorgente.
<function>strtr</function> cercherà sempre prima di incrociare
il testo più lungo e *NON* tenterà di sostituire
parti su cui ha già lavorato.
</para>
<example>
<title>Esempio di uso di <function>strtr</function> con due parametri</title>
<programlisting role="php">
<![CDATA[
<?php
$trans = array("hello" => "hi", "hi" => "hello");
echo strtr("hi all, I said hello", $trans);
?>
]]>
</programlisting>
<para>
Questo visualizzerà:
</para>
<screen>
<![CDATA[
hello all, I said hi
]]>
</screen>
</example>
<note>
<simpara>
I parametri opzionali <parameter>to</parameter> e
<parameter>from</parameter> sono stati aggiunti in PHP 4.0.0
</simpara>
</note>
<para>
Vedere anche <function>ereg_replace</function>.
</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
-->