Date: 12/20/00
- Next message: carlgroh <email protected>: "[PHP-DEV] Don't Get Ripped Off!"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Translating PHP error messages (fwd)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: vitaliyf <email protected>
Operating system: Linux
PHP version: 4.0.3pl1
PHP Bug Type: Strings related
Bug description: ucwords and ucfirst misbehaving with quotes
Another unrelated ucwords/ucfirst bug(?):
<?php
$string = 'this is a "test" with word "test" in quotes';
print ucwords($string);
$string = '"test2" again';
print ucfirst($string);
?>
produces:
This Is A "test" With Word "test" In Quotes
"test2" Again
I understand that by algorithm, first character of each word *IS* upper-cased (because first character is "). However, for us humans, " is not considered a part of a word, therefore "t" in above example should be treated as first letter, and test and test2 should be Test and Test2.
I think that any non-alphanumeric character that is in the beginning of a word (meaning follows a whitespace) should not be considered as "first".
So then:
"test1" - 'test2' would be "Test1" - 'Test2'
"test3" -'test4' would be "Test3" -'Test4'
"test5-test6" would be "Test5-test6"
Comments welcome..
-- Edit Bug report at: http://bugs.php.net/?id=8328&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: carlgroh <email protected>: "[PHP-DEV] Don't Get Ripped Off!"
- Previous message: Andi Gutmans: "Re: [PHP-DEV] Translating PHP error messages (fwd)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

