istersen şu fonksiyonu dene çok daha kapsamlı
function tr($text){
$text = trim($text);
$text = strtolower($text);
$find = array('<b>', '</b>');
$text = str_replace ($find, '', $text);
$find = array(' ', '"', '&', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');
$text = str_replace ($find, '-', $text);
$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
$text = str_replace ($find, '', $text);
$tr_yanlis = array (
'Ç','ç','Ğ','ğ','İ','ı','Ö','ö','Ş','ş','Ü','ü',
'Ç','ç','Äz','ÄŸ','İ','ı','Ö','ö','Åz','ÅŸ','Ü','ü',
'Ç','ç','Ğ','ğ','İ','ı','Ö','ö','Ş','ş','Ü','ü',
'&Ccedil;','&ccedil','Ö','ö','Ü','ü',
'Ð','ð','Ý','ý','Þ','þ',
'Ð','ð','Ý','ý','Þ','þ');
//"'", '"'
$tr_dogru = array (
'C','c','G','g','i','i','O','o','S','s','U','u',
'C','c','G','g','i','i','O','o','S','s','U','u',
'C','c','G','g','i','i','O','o','S','s','U','u',
'C','c','O','o','U','u',
'G','g','i','i','S','s',
'G','g','i','i','S','s');
//''','"'
$text = str_replace($tr_yanlis, $tr_dogru, $text);
$text=str_replace(" ","-",trim($text));
$text=preg_replace("@[^A-Za-z0-9\-_ĞÜŞİÖÇğüşıöç]+@i","",$text);
$text=ereg_replace(" +"," ",trim($text));
$text=ereg_replace("[-]+","-",$text);
$text=ereg_replace("[_]+","_",$text);
return $text ;
}