note 103907 added to function.ucfirst
| From: | Quicker at osu1 dot php dot net | Date: | Tue, 10 May 2011 20:53:38 +0000 |
| Subject: | note 103907 added to function.ucfirst | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179583@lists.php.net to get a copy of this message | ||
if you want to ucfirst for utf8 try this one:
function ucfirst_utf8($stri){
if($stri{0}>="\xc3")
return (($stri{1}>="\xa0"))?
($stri{0}.chr(ord($stri{1})-32)):
($stri{0}.$stri{1});
else return ucfirst($stri{0});
}
It is quick, not language (but utf8) dependend and does not use any mb-functions such as mb_ucfirst.
----
Server IP: 69.147.83.197
Probable Submitter: 92.201.30.144
----
Manual Page -- http://www.php.net/manual/en/function.ucfirst.php
Edit -- https://master.php.net/note/edit/103907
Del: integrated -- https://master.php.net/note/delete/103907/integrated
Del: useless -- https://master.php.net/note/delete/103907/useless
Del: bad code -- https://master.php.net/note/delete/103907/bad+code
Del: spam -- https://master.php.net/note/delete/103907/spam
Del: non-english -- https://master.php.net/note/delete/103907/non-english
Del: in docs -- https://master.php.net/note/delete/103907/in+docs
Del: other reasons-- https://master.php.net/note/delete/103907
Reject -- https://master.php.net/note/reject/103907
Search -- https://master.php.net/manage/user-notes.php