Php Türkçe Karakterleri İngilizce’ye Dönüştürme

<!doctype html>
<html>
<head>
<meta charset=”utf-8″>
<title>Php Türkçe Karakterleri İngilizce’ye Dönüştürme</title>
</head>

<body>
<?
function temizle($tr1) {
$turkce=array(“ş”,”Ş”,”ı”,”ü”,”Ü”,”ö”,”Ö”,”ç”,”Ç”,”ş”,”Ş”,”ı”,”ğ”,”Ğ”,”İ”,”ö”,”Ö”,”Ç”,”ç”,”ü”,”Ü”);
$duzgun=array(“s”,”S”,”i”,”u”,”U”,”o”,”O”,”c”,”C”,”s”,”S”,”i”,”g”,”G”,”I”,”o”,”O”,”C”,”c”,”u”,”U”);
$tr1=str_replace($turkce,$duzgun,$tr1);
$tr1 = preg_replace(“@[^a-z0-9\-_şıüğçİŞĞÜÇ]+@i”,”-“,$tr1);
return $tr1;
}
if (isset($_POST[“submit”]))
{
$karakter = $_POST[“karakter”];
echo “Temiz Metin : “.temizle($karakter).”<br>”;
}
?>
<form action=”” method=”post”>
<input name=”karakter” type=”text” /><br>
<button type=”submit” name=”submit” > Çevir </button>
</form>
</body>
</html>