function temiz($text) {
    $TRBul=array('<','>','script','meta','alert');
    $TRDegistir=array('?','?','?','?','alertt');
    $text=str_replace($TRBul,$TRDegistir,$text);
    $text=strtolower($text);
    return $text;
}
Kullanım
temiz($_POST['x']);