Skip to content

Instantly share code, notes, and snippets.

@Tyrael
Last active August 29, 2015 14:24
Show Gist options
  • Save Tyrael/841d943470f78227b5c9 to your computer and use it in GitHub Desktop.
Save Tyrael/841d943470f78227b5c9 to your computer and use it in GitHub Desktop.
[tyrael@Ferencs-MacBook-Pro en ]$ svn diff
Index: reference/strings/functions/ucwords.xml
===================================================================
--- reference/strings/functions/ucwords.xml (revision 337116)
+++ reference/strings/functions/ucwords.xml (working copy)
@@ -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>
@@ -65,6 +100,22 @@
</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>
+ </para>
</refsect1>
<refsect1 role="notes">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment