Expanded examples for ucwords() and ucfirst() a bit.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@62947 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2001-11-21 18:39:05 +00:00
parent 81467643b7
commit e170865ab2

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.124 $ -->
<!-- $Revision: 1.125 $ -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@ -3788,15 +3788,17 @@ $clean = trim($binary,"\0x00..\0x1F");
<example>
<title><function>ucfirst</function> example</title>
<programlisting role="php">
$text = 'mary had a little lamb and she loved it so.';
$text = ucfirst($text); // $text is now Mary had a little lamb
// and she loved it so.
$foo = 'hello world!';
$foo = ucfirst($text); // Hello world!
$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
</programlisting>
</example>
</para>
<para>
See also <function>strtolower</function> and
<function>strtoupper</function>,
See also <function>strtolower</function>, <function>strtoupper</function>,
and <function>ucwords</function>.
</para>
</refsect1>
@ -3824,9 +3826,12 @@ $text = ucfirst($text); // $text is now Mary had a little lamb
<example>
<title><function>ucwords</function> example</title>
<programlisting role="php">
$text = "mary had a little lamb and she loved it so.";
$text = ucwords($text); // $text is now: Mary Had A Little
// Lamb And She Loved It So.
$foo = 'hello world!';
$foo = ucwords($foo); // Hello World!
$bar = 'HELLO WORLD!';
$bar = ucwords($bar); // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
</programlisting>
</example>
<note>