mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-29 19:53:08 +02:00
069f6629d8
- Upgrade to DocBook5: - All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@238217 c90b9560-bf6c-de11-be94-00142212c4b1
122 lines
3.2 KiB
XML
122 lines
3.2 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.20 $ -->
|
|
<!-- EN-Revision: 1.14 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
|
|
<refentry xml:id="function.wordwrap" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>wordwrap</refname>
|
|
<refpurpose>
|
|
Effectue la césure d'une chaîne
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<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>
|
|
<function>wordwrap</function> retourne la chaîne
|
|
<parameter>str</parameter>, après avoir inséré
|
|
<parameter>break</parameter> tous les <parameter>width</parameter>
|
|
caractères.
|
|
</para>
|
|
<para>
|
|
Par défaut, <function>wordwrap</function> va automatiquement
|
|
insérer une nouvelle ligne en utilisant <literal>\n</literal> tous les
|
|
75 caractères, si <parameter>width</parameter> ou
|
|
<parameter>break</parameter> ne sont pas fournis.
|
|
</para>
|
|
<para>
|
|
Si le paramètre <parameter>cut</parameter> est mis à &true;, la césure de
|
|
la chaîne sera toujours à la taille <parameter>width</parameter>. Si vous
|
|
avez un mot qui est plus long que la taille de césure, il sera
|
|
coupé en morceaux. (Voir le second exemple.)
|
|
<note>
|
|
<para>
|
|
Le paramètre optionnel <parameter>cut</parameter> a
|
|
été ajouté en &php; 4.0.3.
|
|
</para>
|
|
</note>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>wordwrap</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "Portez ce vieux whisky au juge blond qui fume.";
|
|
$newtext = wordwrap( $text, 20 );
|
|
|
|
echo "$newtext\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Portez ce vieux
|
|
whisky au juge
|
|
blond qui fume.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>wordwrap</function> avec césure</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$text = "Un mot très très loooooooooooooooooong.";
|
|
$newtext = wordwrap($text, 8, "\n", true);
|
|
|
|
echo "$newtext\n";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Un mot
|
|
très
|
|
très
|
|
looooooo
|
|
oooooooo
|
|
ooong.
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
Voir aussi
|
|
<function>nl2br</function> et
|
|
<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:"../../../../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
|
|
--> |