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
 [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

Pull Requests

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 Nov 28 21:01:29 2024 UTC