document the second optional delimiters argument for ucwords

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337118 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ferenc Kovacs 2015-07-07 16:20:58 +00:00
parent 415c4e34d4
commit 84fd583940

View file

@ -11,6 +11,9 @@
<methodsynopsis>
<type>string</type><methodname>ucwords</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam choice="opt">
<type>string</type><parameter>delimiters</parameter><initializer>" \t\r\n\f\v"</initializer>
</methodparam>
</methodsynopsis>
<para>
Returns a string with the first character of each word in
@ -18,8 +21,8 @@
</para>
<para>
The definition of a word is any string of characters that is immediately
after a whitespace (These are: space, form-feed, newline, carriage return,
horizontal tab, and vertical tab).
after any character listed in the <parameter>delimiters</parameter> parameter
(By default these are: space, form-feed, newline, carriage return, horizontal tab, and vertical tab).
</para>
</refsect1>
@ -35,6 +38,14 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>delimiters</parameter></term>
<listitem>
<para>
The optional <parameter>delimiters</parameter> contains the word separator characters.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
@ -46,6 +57,30 @@
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.4.32, 5.5.16</entry>
<entry>
Added the <parameter>delimiters</parameter> parameter.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
@ -61,6 +96,22 @@ $bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
?>
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title><function>ucwords</function> example with custom delimiter</title>
<programlisting role="php">
<![CDATA[
<?php
$foo = 'hello|world!';
$bar = ucwords($foo); // Hello|world!
$baz = ucwords($foo, "|"); // Hello|World!
?>
]]>
</programlisting>
</example>