Req #34407 [Opn]: ucwords and Title Case

From: Date: Sat, 12 Jul 2014 03:23:11 +0000
Subject: Req #34407 [Opn]: ucwords and Title Case
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186572@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 Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: All PHP Version: 4.4.0 Block user comment: N Private report: N New Comment: With the fix in place you can now do: ucwords(strtolower($foo), ' (')); Previous Comments: ------------------------------------------------------------------------ [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 (#186572) next »