php.net |  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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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  
capitalized.  
  
Here's a quick example, pasted from an xterm.  
  
-- snip --  
ieure!Phaktory:~$ cat ucwords.php  
#!/usr/bin/php4 -q  
<?php 
echo ucwords($_SERVER['argv'][1])."\n";  
?>  
ieure!Phaktory:~$ ./ucwords.php 'test'  
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)  
ieure!Phaktory:~$  
-- 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: 
 
<?php 
echo ucwords($_GET['string']); 
?> 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 12:01:27 2024 UTC