mirror of
https://github.com/php/doc-it.git
synced 2026-03-24 15:42:46 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/it/trunk@314558 c90b9560-bf6c-de11-be94-00142212c4b1
119 lines
3.3 KiB
XML
119 lines
3.3 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.142 -->
|
|
<refentry xml:id="function.wordwrap" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>wordwrap</refname>
|
|
<refpurpose>
|
|
Divide una stringa ad un certo numero di caratteri utilizzando
|
|
il carattere di divisione
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Descrizione</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>wordwrap</methodname>
|
|
<methodparam><type>string</type><parameter>str</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>width</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>break</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>cut</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Restituisce una stringa con <parameter>str</parameter> suddivisa
|
|
alla colonna indicata dal parametro opzionale
|
|
<parameter>width</parameter>. La linea è interrotta utilizzando
|
|
il parametro opzionale <parameter>break</parameter>.
|
|
</para>
|
|
<para>
|
|
<function>wordwrap</function> interrompe automaticamente la stringa alla colonna
|
|
75 ed utilizza come carattere di interruzione '<literal>\n</literal>' (newline), se non sono
|
|
dati <parameter>width</parameter> e
|
|
<parameter>break</parameter>
|
|
</para>
|
|
<para>
|
|
Se il parametro <parameter>cut</parameter> è impostato a 1, la stringa
|
|
è sempre interrotta alla lunghezza indicata. Pertanto se una parola
|
|
supera la larghezza data, questa verrà interrotta.
|
|
(Vedere il secondo esempio).
|
|
<note>
|
|
<para>
|
|
Il parametro opzionale <parameter>cut</parameter> è stato aggiunto in PHP
|
|
4.0.3
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<example>
|
|
<title>Esempio di uso di <function>wordwrap</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "The quick brown fox jumped over the lazy dog.";
|
|
$newtext = wordwrap($text, 20, "<br />\n");
|
|
|
|
echo $newtext;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Questo esempio visualizza:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
The quick brown fox<br />
|
|
jumped over the lazy<br />
|
|
dog.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<example>
|
|
<title>Esempio di uso di <function>wordwrap</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "A very long woooooooooooord.";
|
|
$newtext = wordwrap($text, 8, "\n", 1);
|
|
|
|
echo "$newtext\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
Questo esempio visualizza:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
A very
|
|
long
|
|
wooooooo
|
|
ooooord.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
<para>
|
|
Vedere anche <function>nl2br</function> e
|
|
<function>chunk_split</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
|
|
-->
|