From e170865ab2f0f69028faf0225a58f98261849b7d Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Wed, 21 Nov 2001 18:39:05 +0000 Subject: [PATCH] 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 --- functions/strings.xml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/functions/strings.xml b/functions/strings.xml index b12f0eb9ce..78e38ec0e6 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -1,5 +1,5 @@ - + String functions Strings @@ -3788,15 +3788,17 @@ $clean = trim($binary,"\0x00..\0x1F"); <function>ucfirst</function> example -$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! - See also strtolower and - strtoupper, + See also strtolower, strtoupper, and ucwords. @@ -3824,9 +3826,12 @@ $text = ucfirst($text); // $text is now Mary had a little lamb <function>ucwords</function> example -$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!