php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42599 ucwords functionality change
Submitted: 2007-09-08 20:30 UTC Modified: 2021-09-21 12:04 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: phpbugs at add dot za dot net Assigned: cmb (profile)
Status: Closed Package: Strings related
PHP Version: 5.2.4 OS: n/a
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugs at add dot za dot net
New email:
PHP Version: OS:

 

 [2007-09-08 20:30 UTC] 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)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-04-08 21:16 UTC] jani@php.net
-Package: Feature/Change Request +Package: Strings related
 [2021-09-21 12:04 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2021-09-21 12:04 UTC] cmb@php.net
ucwords() accepts a second argument $separators which allows to
specify the desired word separators.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 13 05:01:27 2024 UTC