added wordwrap() documentation and example.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@30784 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Daniel Beckham 2000-08-21 22:33:33 +00:00
parent aa03eb671d
commit 8750c0e354

View file

@ -1028,8 +1028,9 @@ $colon_separated = implode (":", $array);
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>
@ -3059,6 +3060,69 @@ $text = ucwords($text); // $text is now: Mary Had A Little
</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>
<!-- Keep this comment at the end of the file