note 97667 added to function.strtoupper
| From: | smieat at osu1 dot php dot net | Date: | Sat, 01 May 2010 23:39:40 +0000 |
| Subject: | note 97667 added to function.strtoupper | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168847@lists.php.net to get a copy of this message | ||
perfect solutions for turkish utf-8 (including i I conversations):
function strtolowertr($metin){
return mb_convert_case(str_replace('I','ı',$metin), MB_CASE_LOWER,
"UTF-8");
}
function strtouppertr($metin){
return mb_convert_case(str_replace('i','İ',$metin), MB_CASE_UPPER,
"UTF-8");
}
function ucwordstr($metin) {
return ltrim(mb_convert_case(str_replace(array(' I',' ı', ' İ',
' i'),array(' I',' I',' İ',' İ'),'
'.$metin), MB_CASE_TITLE, "UTF-8"));
}
function ucfirsttr($metin) {
$metin = in_array(crc32($metin[0]),array(1309403428, -797999993, 957143474)) ?
array(strtouppertr(substr($metin,0,2)),substr($metin,2)) :
array(strtouppertr($metin[0]),substr($metin,1));
return $metin[0].$metin[1];
}
----
Server IP: 69.147.83.197
Probable Submitter: 85.105.29.246
----
Manual Page -- http://www.php.net/manual/en/function.strtoupper.php
Edit -- https://master.php.net/note/edit/97667
Del: integrated -- https://master.php.net/note/delete/97667/integrated
Del: useless -- https://master.php.net/note/delete/97667/useless
Del: bad code -- https://master.php.net/note/delete/97667/bad+code
Del: spam -- https://master.php.net/note/delete/97667/spam
Del: non-english -- https://master.php.net/note/delete/97667/non-english
Del: in docs -- https://master.php.net/note/delete/97667/in+docs
Del: other reasons-- https://master.php.net/note/delete/97667
Reject -- https://master.php.net/note/reject/97667
Search -- https://master.php.net/manage/user-notes.php