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(' ', '&quot;', '&amp;', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');
    $text = str_replace ($find, '-', $text);

    $find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
    $text = str_replace ($find, '', $text);


    


$tr_yanlis = array (
'Ç','ç','Ğ','ğ','İ','ı','Ö','ö','Ş','ş','Ü','ü',
'Ç','ç','Äz','ÄŸ','İ','ı','Ö','ö','Åz','ÅŸ','Ü','ü',
'Ç','ç','Ğ','ğ','İ','ı','Ö','ö','Ş','ş','Ü','ü',
'&amp;Ccedil;','&amp;ccedil','&Ouml;','&ouml;','&Uuml;','&uuml;',
'&ETH;','&eth;','&Yacute;','&yacute;','&THORN;','&thorn;',
'&ETH;','&eth;','&Yacute;','&yacute;','&THORN;','&thorn;');
//"'", '"'
$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');
//'&apos;','&quot;'



$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 ; 
}