note 107700 added to function.ucfirst
| From: | qeremy | Date: | Mon, 27 Feb 2012 16:41:47 +0000 |
| Subject: | note 107700 added to function.ucfirst | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186400@lists.php.net to get a copy of this message | ||
A proper Turkish solution;
<?php
function ucfirst_turkish($str) {
$tmp = preg_split("//u", $str, 2, PREG_SPLIT_NO_EMPTY);
return mb_convert_case(
str_replace("i", "İ", $tmp[0]), MB_CASE_TITLE, "UTF-8").
$tmp[1];
}
$str = "iyilik güzelLİK";
echo ucfirst($str) ."\n"; // Iyilik güzelLİK
echo ucfirst_turkish($str); // İyilik güzelLİK
?>
----
Server IP: 69.147.83.197
Probable Submitter: 194.27.149.90
----
Manual Page -- http://www.php.net/manual/en/function.ucfirst.php
Edit -- https://master.php.net/note/edit/107700
Del: integrated -- https://master.php.net/note/delete/107700/integrated
Del: useless -- https://master.php.net/note/delete/107700/useless
Del: bad code -- https://master.php.net/note/delete/107700/bad+code
Del: spam -- https://master.php.net/note/delete/107700/spam
Del: non-english -- https://master.php.net/note/delete/107700/non-english
Del: in docs -- https://master.php.net/note/delete/107700/in+docs
Del: other reasons-- https://master.php.net/note/delete/107700
Reject -- https://master.php.net/note/reject/107700
Search -- https://master.php.net/manage/user-notes.php