Bu fonsiyon iþini görecektir.
function cleanTr(&$text){
$text = str_replace ( array ("İ", "\u0130", "\xDD", "Ý" ), "I",
$text );
$text = str_replace ( array ("ı", "\u0131", "\xFD", "ý" ), "i",
$text );
$text = str_replace ( array ("Ğ", "\u011e", "\xD0", "Ð" ), "G",
$text );
$text = str_replace ( array ("ğ", "\u011f", "\xF0", "ð" ), "g",
$text );
$text = str_replace ( array ("Ü", "\u00dc", "\xDC", "Ü" ), "U",
$text );
$text = str_replace ( array ("ü", "\u00fc", "\xFC", "ü" ), "u",
$text );
$text = str_replace ( array ("Ş", "\u015e", "\xDE", "Þ" ), "S",
$text );
$text = str_replace ( array ("ş", "\u015f", "\xFE", "þ" ), "s",
$text );
$text = str_replace ( array ("Ö", "\u00d6", "\xD6", "Ö" ), "O",
$text );
$text = str_replace ( array ("ö", "\u00f6", "\xF6", "ö" ), "o",
$text );
$text = str_replace ( array ("Ç", "\u00c7", "\xC7", "Ç" ),
"C", $text );
$text = str_replace ( array ("ç", "\u00e7", "\xE7", "ç" ),
"c", $text );
}
15 Aðustos 2008 Cuma 11:10 tarihinde Erdem Uyguner <erdem.linux_at_gmail.com>yazdý:
> Herkese günaydýn...
>
> php ile dosya upload ederken, dosya adýndaki türkçe karakterlerde
> sorun yaþýyorum bunu düzeltmek için birkaç tane fonksiyon buldum ancak
> herhangi bir düzelme olmadý. Kullandýðým fonksiyonlar
>
> function isimTR($str) {
> $str = trim($str);
> $search =
> array(chr(199),chr(231),chr(208),chr(240),chr(253),chr(221),chr(214),chr(246),chr(222),chr(254)
> ,chr(220),chr(252),chr(32));
> $replace = array('C','c','G','g','i','I','O','o','S','s','U','u','_');
> $newstr = str_replace($search,$replace,$str);
> return $newstr;
> }
>
> ve
>
> function turkcesiz($Gelen)
> {
> $Donus = strtr($Gelen,"ÜÞÇÝÐüöþçýð","USCIGuoscig");
> return $Donus;
> }
>
> bu sorunu nasýl çözebileceðim hakkýnda fikri olan arkadaþlar yardým
> ederse sevinirim...
>
> Zaman ayýrýp cevap yazan arkadaþlara þimdiden çok teþekkür ederim.
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama_at_liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
-- Ýyi çalýþmalar; Tümay ÇEBER
_______________________________________________
Linux-programlama mailing list
Linux-programlama_at_liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama
Received on Fri 15 Aug 2008 - 12:03:30 EEST