|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2005-09-07 13:32 UTC] peebidj at hotmail dot com
 Description: ------------ Non alphanumeric characters are influencing the functionality of strtolower and ucwords. When a character in the example is right after a parenthesis, that character is not seen as the first in the word, and hence is not capitalized. This was reported and dismissed earlier, however, I feel that this is something that needs to be looked at, since common sense tells us that any non-alphanumeric character cannot be capitilized. Reproduce code: --------------- $foo = "Krung Thep (Bangkok)"; $bar = ucwords(strtolower($foo)); echo $foo; Expected result: ---------------- Krung Thep (Bangkok) Actual result: -------------- Krung Thep (bangkok) PatchesPull Requests
Pull requests: 
 HistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 11:00:01 2025 UTC | 
With the fix in place you can now do: ucwords(strtolower($foo), ' ('));