note 110430 deleted from function.ucwords by danbrown
| From: | danbrown@php.net | Date: | Thu, 06 Dec 2012 14:35:43 +0000 |
| Subject: | note 110430 deleted from function.ucwords by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192345@lists.php.net to get a copy of this message | ||
Note Submitter: omer dot olmez at googlemail dot com
----
function strtolowerTr($string) {
$low=array("Ã" => "ü", "Ã" =>
"ö", "Ä" => "Ä", "Å" => "Å",
"Ã" => "ç", "İ" => "i", "I" =>
"ı");
return strtolower(strtr($string,$low));
}
function ucwordsTr($str) {
$str = $this->strtolowerTr($str);
$arr = explode(' ', $str);
$new = array("Ã", "Ã", "Ä", "Å",
"Ã", "İ", "I");
$old = array("ü", "ö", "Ä", "Å",
"ç", "i", "ı");
foreach($arr as $foo) {
$first = str_replace($old, $new, mb_substr($foo, 0, 1));
$newStr[] = ($first . strtolower(mb_substr($foo, 1)));
}
return ucwords(implode(' ', $newStr));
}