#42599 [Opn]: ucwords functionality change
| From: | felipe@php.net | Date: | Mon, 03 Dec 2007 15:23:13 +0000 |
| Subject: | #42599 [Opn]: ucwords functionality change | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-120322@lists.php.net to get a copy of this message | ||
ID: 42599
Updated by: felipe@php.net
Reported By: phpbugs at add dot za dot net
Status: Open
Bug Type: Feature/Change Request
Operating System: n/a
PHP Version: 5.2.4
New Comment:
Simple patch:
http://ecl.zoone.com.br/etc/patches/ucwords.patch
phpt:
http://ecl.zoone.com.br/etc/patches/ucwords.phpt
Previous Comments:
------------------------------------------------------------------------
[2007-09-08 20:30:31] phpbugs at add dot za dot net
Description:
------------
In the manual it is stated that a ucwords will uppercase any words that
are preceded by a space.
Maybe this should be changed to include any words that are preceded by
a bracket as well, such as "... (words inside)".
I know that one can use mb_convert_case to do this, but one might argue
that ucwords implies this functionality, and it could come to be
expected from it (until you read the manual page).
Reproduce code:
---------------
<?
print ucwords("outside of (inside of)");
?>
Expected result:
----------------
Outside Of (Inside Of)
Actual result:
--------------
Outside Of (inside Of)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42599&edit=1