Req #34407 [Opn->Csd]: ucwords and Title Case

From: Date: Sat, 12 Jul 2014 03:25:00 +0000
Subject: Req #34407 [Opn->Csd]: ucwords and Title Case
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186573@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=34407&edit=1 ID: 34407 Updated by: datibbaw@php.net Reported by: peebidj at hotmail dot com Summary: ucwords and Title Case -Status: Open +Status: Closed Type: Feature/Change Request -Package: *General Issues +Package: Strings related Operating System: All PHP Version: 4.4.0 -Assigned To: +Assigned To: datibbaw Block user comment: N Private report: N New Comment: The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2014-07-12 03:23:10] datibbaw@php.net With the fix in place you can now do: ucwords(strtolower($foo), ' (')); ------------------------------------------------------------------------ [2005-09-07 13:32:47] 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=34407&edit=1

« previous php.bugs (#186573) next »