<?php
function replaceSpecialChar($strParam){
$regex = "/\/|\~|\!|\@|\#|\\$|\%|\^|\&|\*|\(|\)|\_|\+|\{|\}|\:|\<|\>|\?|\[|\]|\,|\.|\/|\;|\'|\`|\-|\=|\\\|\|/";
return preg_replace($regex,"",$strParam);
}
$str = "abcde~!@#$%^&*()_+{}:|<>?,./;'[]\-=`xtz";
$str = replaceSpecialChar($str);
echo "$str\n";
?>