note 110430 deleted from function.ucwords by danbrown

From: 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)); }

« previous php.notes (#192345) next »