note 106702 added to function.ucfirst
| From: | tierwerwolf at gmail dot com | Date: | Tue, 29 Nov 2011 14:44:44 +0000 |
| Subject: | note 106702 added to function.ucfirst | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184782@lists.php.net to get a copy of this message | ||
$str[0] - give us �. That is wrong. So we will use string connection by '.' beetween
Upper letter and other part of string.
One more solution for UTF-8 ( works fine for Cyrillic e.t.c).
function mb_ucasefirst($str){
/** here you can use your own encoding.
2 main lines
**/
mb_internal_encoding("UTF-8");
mb_regex_encoding("UTF-8");
return mb_substr(mb_strtoupper($str),0,1) . mb_substr($str,1,strlen($str));
}
----
Server IP: 195.54.192.44
Probable Submitter: 85.93.157.67
----
Manual Page -- http://www.php.net/manual/en/function.ucfirst.php
Edit -- https://master.php.net/note/edit/106702
Del: integrated -- https://master.php.net/note/delete/106702/integrated
Del: useless -- https://master.php.net/note/delete/106702/useless
Del: bad code -- https://master.php.net/note/delete/106702/bad+code
Del: spam -- https://master.php.net/note/delete/106702/spam
Del: non-english -- https://master.php.net/note/delete/106702/non-english
Del: in docs -- https://master.php.net/note/delete/106702/in+docs
Del: other reasons-- https://master.php.net/note/delete/106702
Reject -- https://master.php.net/note/reject/106702
Search -- https://master.php.net/manage/user-notes.php