note 111145 added to function.lcfirst
| From: | qeremy | Date: | Sat, 19 Jan 2013 18:56:10 +0000 |
| Subject: | note 111145 added to function.lcfirst | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193272@lists.php.net to get a copy of this message | ||
A simple approach to unicode lc;
<?php
function lcfirst_unicode($str) {
return mb_convert_case(
mb_substr($str, 0, 1), MB_CASE_LOWER) .
mb_substr($str, 1);
}
?>
By the way...
<?php
function lcwords_unicode($str) {
return preg_replace_callback('/(\w+)/u', function($s) {
return lcfirst_unicode($s[1]);
}, $str);
}
?>
----
Server IP: 95.130.168.26
Probable Submitter: 88.253.79.190
----
Manual Page -- http://php.net/manual/en/function.lcfirst.php
Edit -- https://master.php.net/note/edit/111145
Del: integrated -- https://master.php.net/note/delete/111145/integrated
Del: useless -- https://master.php.net/note/delete/111145/useless
Del: bad code -- https://master.php.net/note/delete/111145/bad+code
Del: spam -- https://master.php.net/note/delete/111145/spam
Del: non-english -- https://master.php.net/note/delete/111145/non-english
Del: in docs -- https://master.php.net/note/delete/111145/in+docs
Del: other reasons-- https://master.php.net/note/delete/111145
Reject -- https://master.php.net/note/reject/111145
Search -- https://master.php.net/manage/user-notes.php