时间:2021-07-01 10:21:17 帮助过:2人阅读
安全的过滤函数:
function filter($input){
$input=strip_tags(trim($input));
$input=htmlentities($input,ENT_QUOTES,'UTF-8');
$input=str_ireplace(
array('\\','script','expression'),
array('\','script','expression')
);
return $input;
}相关推荐:
浅析php过滤html字符串,防止SQL注入
php array_filter 过滤数组中的空值
以上就是php安全过滤 的详细内容,更多请关注Gxl网其它相关文章!