php正则表达式替换大地址

function replace_specialChar($strParam){
 

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

posted on 2015-05-12 15:45  陈可  阅读(301)  评论(0)    收藏  举报

导航