Bug #14412: ucwords() new parameter
| From: | pulstar at mail dot com | Date: | Mon, 10 Dec 2001 21:07:12 +0000 |
| Subject: | Bug #14412: ucwords() new parameter | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-73116@lists.php.net to get a copy of this message | ||
From: pulstar@mail.com
Operating system: Linux
PHP version: 4.0.6
PHP Bug Type: Feature/Change Request
Bug description: ucwords() new parameter
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 bug report at: http://bugs.php.net/?id=14412&edit=1