Req #42599 [Opn->Csd]: ucwords functionality change

From: Date: Tue, 21 Sep 2021 12:04:55 +0000
Subject: Req #42599 [Opn->Csd]: ucwords functionality change
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236724@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=42599&edit=1 ID: 42599 Updated by: cmb@php.net Reported by: phpbugs at add dot za dot net Summary: ucwords functionality change -Status: Open +Status: Closed Type: Feature/Change Request Package: Strings related Operating System: n/a PHP Version: 5.2.4 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: ucwords() accepts a second argument $separators which allows to specify the desired word separators. Previous Comments: ------------------------------------------------------------------------ [2007-12-03 15:23:12] felipe@php.net Simple patch: http://ecl.zoone.com.br/etc/patches/ucwords.patch phpt: http://ecl.zoone.com.br/etc/patches/ucwords.phpt ------------------------------------------------------------------------ [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 https://bugs.php.net/bug.php?id=42599&edit=1

« previous php.bugs (#236724) next »