[PHP-DOC] cvs: phpdoc /en/functions strings.xml From: Daniel Beckham (danbeck <email protected>)
Date: 08/21/00

danbeck Mon Aug 21 15:33:33 2000 EDT

  Modified files:
    /phpdoc/en/functions strings.xml
  Log:
  added wordwrap() documentation and example.
  
Index: phpdoc/en/functions/strings.xml
diff -u phpdoc/en/functions/strings.xml:1.39 phpdoc/en/functions/strings.xml:1.40
--- phpdoc/en/functions/strings.xml:1.39 Mon Aug 21 01:50:49 2000
+++ phpdoc/en/functions/strings.xml Mon Aug 21 15:33:33 2000
@@ -1028,8 +1028,9 @@
      before all newlines.
     </para>
     <para>
- See also <function>htmlspecialchars</function> and
- <function>htmlentities</function>.
+ See also <function>htmlspecialchars</function>,
+ <function>htmlentities</function> and
+ <function>wordwrap</function>.
     </para>
    </refsect1>
   </refentry>
@@ -3058,6 +3059,69 @@
     </para>
    </refsect1>
   </refentry>
+
+
+ <refentry id="function.wordwrap">
+ <refnamediv>
+ <refname>wordwrap</refname>
+ <refpurpose>
+ Wraps a string to a given number of characters using a string
+ break character.
+ </refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcprototype>
+ <funcdef>string <function>wordwrap</function></funcdef>
+ <paramdef>string <parameter>str</paramter></paramdef>
+ <paramdef>int
+ <parameter><optional>width</optional></parameter>
+ </paramdef>
+ <paramdef>string
+ <parameter><optional>break</optional></parameter>
+ </paramdef>
+ </funcprototype>
+ </funcsynopsis>
+ <para>
+ Wraps the string <parameter>str</parameter> at the column number
+ specified by the (optional) <parameter>width</parameter>
+ parameter. The line is broken using the (optional)
+ <parameter>break</parameter> parameter.
+ </para>
+ <para>
+ <function>wordwrap</function> will automatically wrap at column
+ 75 and break using '\n' (newline) if <parameter>width</parameter>
+ or <parameter>break</parameter> are not given.
+ </para>
+ <para>
+ <example>
+ <title><function>wordwrap</function> example</title>
+ <programlisting role="php">
+$text = "The quick brown fox jumped over the lazy dog.";
+$newtext = wordwrap( $text, 20 );
+
+echo "$newtext\n";
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ This example would display:
+ </para>
+ <para>
+ <informalexample>
+ <programlisting>
+The quick brown fox
+ jumped over the lazy dog.
+ </programlisting>
+ </informalexample>
+ </para>
+ <para>
+ See also <function>nl2br</function>.
+ </para>
+ </refsec1>
+ </refentry>
+
 
  </reference>