首页建站经验 php安全过滤函数

php安全过滤函数

项目开发中需要的php安全过滤函数,希望对大家所有帮助,代码很简单。function safe_replace($string) {$string = str_replace('%20','',$string);$string = str_replace('%27'…

项目开发中需要的php安全过滤函数,希望对大家所有帮助,代码很简单。

function safe_replace($string) {

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

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

$string = str_replace('%2527','',$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;

}

 

本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/jianzhan/jingyan/17154.html
上一篇PHP操作Session和Cookie
下一篇 php将数组转换为字符串函数
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部