note 106702 deleted from function.ucfirst by danbrown
| From: | danbrown@php.net | Date: | Tue, 29 Nov 2011 15:41:40 +0000 |
| Subject: | note 106702 deleted from function.ucfirst by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184784@lists.php.net to get a copy of this message | ||
Note Submitter: tierwerwolf at gmail dot com
----
$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));
}