mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
- Updated extra function parameter to wordwrap.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@32511 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
0ebe207e69
commit
6c9a370fc5
1 changed files with 34 additions and 1 deletions
|
@ -2944,6 +2944,9 @@ $text = ucwords($text); // $text is now: Mary Had A Little
|
|||
<paramdef>string
|
||||
<parameter><optional>break</optional></parameter>
|
||||
</paramdef>
|
||||
<paramdef>int
|
||||
<parameter><optional>cut</optional></parameter>
|
||||
</paramdef>
|
||||
</funcprototype>
|
||||
</funcsynopsis>
|
||||
<para>
|
||||
|
@ -2957,6 +2960,12 @@ $text = ucwords($text); // $text is now: Mary Had A Little
|
|||
75 and break using '\n' (newline) if <parameter>width</parameter>
|
||||
or <parameter>break</parameter> are not given.
|
||||
</para>
|
||||
<para>
|
||||
If the <parameter>cut</parameter> is set to 1, the string is
|
||||
always wrapped at the specified width. So if you have a word
|
||||
that is larger than the given width, it is broken appart.
|
||||
(See second example).
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>wordwrap</function> example</title>
|
||||
|
@ -2975,7 +2984,31 @@ echo "$newtext\n";
|
|||
<informalexample>
|
||||
<programlisting>
|
||||
The quick brown fox
|
||||
jumped over the lazy dog.
|
||||
jumped over the lazy dog.
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>wordwrap</function> example</title>
|
||||
<programlisting role="php">
|
||||
$text = "A very long woooooooooooord.";
|
||||
$newtext = wordwrap( $text, 8, "\n", 1);
|
||||
|
||||
echo "$newtext\n";
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
This example would display:
|
||||
</para>
|
||||
<para>
|
||||
<informalexample>
|
||||
<programlisting>
|
||||
A very
|
||||
long
|
||||
wooooooo
|
||||
ooooord.
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
|
Loading…
Reference in a new issue