PHP自定义函数(7)--- 特殊字符过滤

2019-05-13T14:02:00
function format_str1($str){
    $str = str_replace("\r\n","",$str);
    $str = str_replace("\n","",$str);
    $str = str_replace("\r","",$str);
    $str = str_replace("'","&#39",$str);
    $str = str_replace("\"","б▒",$str);
    $str = str_replace("<","г╝",$str);
    $str = str_replace(">","г╛",$str);
    $str = str_replace("php","",$str);
  //$str = str_replace("?","г┐",$str);
    $str = str_replace("eval","",$str);
    $str = str_replace("%","ге",$str);
    $str = str_replace("$","",$str);
    $str = str_replace("script"," ",$str);
  //$str = str_replace("="," ",$str);
    $str = str_replace("and"," ",$str);
    $str = str_replace("select"," ",$str);
    $str = str_replace("delete"," ",$str);
    $str = str_replace("update"," ",$str);
    return $str;
}
当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »