|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21626 ucwords() fails to capitalize words in parenthesis
Submitted: 2003-01-13 19:06 UTC Modified: 2003-01-13 19:16 UTC
From: ieure at debian dot org Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.2.1 OS: Debian GNU/Linux 3.0 (Woody)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ieure at debian dot org
New email:
PHP Version: OS:


 [2003-01-13 19:06 UTC] ieure at debian dot org
When using ucwords() on a string which contains words in  
parenthesis, the first word in the parenthesis is not  
Here's a quick example, pasted from an xterm.  
-- snip --  
ieure!Phaktory:~$ cat ucwords.php  
#!/usr/bin/php4 -q  
echo ucwords($_SERVER['argv'][1])."\n";  
ieure!Phaktory:~$ ./ucwords.php 'test'  
ieure!Phaktory:~$ ./ucwords.php 'test test'  
Test Test  
ieure!Phaktory:~$ ./ucwords.php 'test test (test)'  
Test Test (test)  
ieure!Phaktory:~$ ./ucwords.php 'test test (test test)'  
Test Test (test Test)  
ieure!Phaktory:~$ ./ucwords.php 'test test ( test test)'  
Test Test ( Test Test)  
-- snip --  
As you can see, ucwords() won't capitalize the first 'test'  
when there is no whitespace between the open-parenthesis  
and the first letter.  
Affects both CGI and Apache module versions. Here's the 
script I used to test the apache module: 
echo ucwords($_GET['string']); 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-13 19:16 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Jun 05 21:03:37 2023 UTC