PHP过滤指定字符串,过滤危险字符



安全过滤函数,用于过滤危险字符

function safe_replace($string) {

 $string = str_replace('
','',$string);

 $string =
str_replace(''','',$string);

 $string =
str_replace(''','',$string);

 $string =
str_replace('*','',$string);

 $string =
str_replace('"','"',$string);

 $string =
str_replace("'",'',$string);

 $string =
str_replace('"','',$string);

 $string =
str_replace(';','',$string);

 $string =
str_replace('<','<',$string);

 $string =
str_replace('>','>',$string);

 $string =
str_replace("{",'',$string);

 $string =
str_replace('}','',$string);

 return $string;

}

上一篇:CR0,CR3寄存器


下一篇:html5 响应式布局(媒体查询)