Req #14412 [Opn->Wfx]: ucwords() new parameter

From: Date: Thu, 08 Jan 2015 22:25:36 +0000
Subject: Req #14412 [Opn->Wfx]: ucwords() new parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189757@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=14412&edit=1 ID: 14412 Updated by: ajf@php.net Reported by: pulstar at mail dot com Summary: ucwords() new parameter -Status: Open +Status: Wont fix Type: Feature/Change Request Package: Strings related Operating System: Linux PHP Version: 4.0.6 Block user comment: N Private report: N New Comment: This seems prone to not working properly. There are 3- and 4-character English words which shouldn't be uppercased. It's been 13 years and I doubt this'll be done. Previous Comments: ------------------------------------------------------------------------ [2001-12-10 16:07:12] pulstar at mail dot com Ucwords() should have an optional parameter to set the minimum of characters a word must have to be capitalized. For example, sometimes I don't want to capitalize words with less than 3 characters. Examples: New York Institute Of Photography New York Institute of Photography (better) My Web Site Is Cool With PHP My Web Site is Cool With PHP (better) Well, may the first word be capitalized by ucwords() even if its size is less than specified by the parameter? In any case we can capitalize it with ucfirst(). :-) $str=ucfirst(ucwords(strtolower($str),3)); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=14412&edit=1

« previous php.bugs (#189757) next »