您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php安全过滤字符串函数

2024/7/17 22:51:03发布12次查看
php安全过滤字符串函数
分享一个php过滤字符串函数,具体代码如下:
function striphtml($string){
$pattern=array (''si, ''si, ''si, '([\r\n])[\s]+', '&(quot|#34);'i, '&(amp|#38);'i, '&(lt|#60);'i, '&(gt|#62);'i, '&(nbsp|#160);'i, '&(iexcl|#161);'i, '&(cent|#162);'i, '&(pound|#163);'i, '&(copy|#169);'i, '&#(\d+);'e);
$replace=array ('', '', \\1, '', &, , ' ', chr(161), chr(162), chr(163), chr(169), chr(\\1));
return preg_replace ($pattern, $replace, $str);
}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product