note 104005 deleted from function.ucfirst by danbrown
| From: | danbrown@php.net | Date: | Tue, 17 May 2011 14:12:41 +0000 |
| Subject: | note 104005 deleted from function.ucfirst by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179794@lists.php.net to get a copy of this message | ||
Note Submitter: Quicker
----
UPDATE! The ucfirst_utf8 in my last reply returned just the first character, which does not match
the original ucfirst.
So here is the corrected one:
function ucfirst_utf8($stri){
if($stri{0}>="\xc3")
return (($stri{1}>="\xa0")?
($stri{0}.chr(ord($stri{1})-32)):
($stri{0}.$stri{1})).substr($stri,2);
else return ucfirst($stri);
}
Hope this helps anyway.