狗林技术

  • 首页
  • 技术分享
    • PHP
    • Go
    • Linux
    • JavaScript
    • Vue
    • 其他

Menu

  • 首页
  • 技术分享
    • PHP
    • Go
    • Linux
    • JavaScript
    • Vue
    • 其他
  • 1970.01.01遇到Undefined constant "CURL_SSLVERSION_TLSv1_2"错误
  • 1970.01.01linux防火墙操作
  • 1970.01.01linux centos系统安装php的redis扩展
  • 1970.01.01Golang实现自定义JWT生成与验证
  • 1970.01.01php项目中Nginx文件解析漏洞
  • 1970.01.01Nginx配置跨域
更多
个人简介
个人简介


职业:PHP开发,Go开发

          前端开发

现居:浙江省-杭州市

Email:1047571953@qq.com

                               

热门文章

  • git的学习过程

    git的一些常用命令

  • Go文档

    Go http://www.topgoer.com gorm https://learnku.com/docs/gorm/v2/about-mirror-image/9754 gin https://www.kancloud.cn/lhj0702/sockstack_gin/1805355

  • tp5.1用GatewayWorker做一个简单的聊天室

    tp5.1用GatewayWorker做一个简单的聊天室 , 源码文件

  • TP5.1 查询数据库中上一条和下一条记录

    ->where("id", ">", $id)->order("id", "asc")->find();<br/> ​->where('id' , '<' , $id)->order("id", "desc")->find();

联系我

    zxl77l 微信号 1047571953@qq.com QQ邮箱 1047571953 QQ号

php过滤HTML标签

分类:PHP   作者:   - 发布于:2020/12/23   1055

标签过滤

$str=preg_replace("/<s*imgs+[^>]*?srcs*=s*('|")(.*?)\1[^>]*?/?s*>/i","", $str); //过滤img标签
 
$str=preg_replace("/s+/","", $str); //过滤多余回车
 
$str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格)
 
$str=preg_replace("/<!--.*?-->/si","",$str); //注释
 
$str=preg_replace("/<(!.*?)>/si","",$str); //过滤DOCTYPE
 
$str=preg_replace("/<(/?html.*?)>/si","",$str); //过滤html标签
 
$str=preg_replace("/<(/?head.*?)>/si","",$str); //过滤head标签
 
$str=preg_replace("/<(/?meta.*?)>/si","",$str); //过滤meta标签
 
$str=preg_replace("/<(/?body.*?)>/si","",$str); //过滤body标签
 
$str=preg_replace("/<(/?link.*?)>/si","",$str); //过滤link标签
 
$str=preg_replace("/<(/?form.*?)>/si","",$str); //过滤form标签
 
$str=preg_replace("/cookie/si","COOKIE",$str); //过滤COOKIE标签
 
$str=preg_replace("/<(applet.*?)>(.*?)<(/applet.*?)>/si","",$str); //过滤applet标签
 
$str=preg_replace("/<(/?applet.*?)>/si","",$str); //过滤applet标签
 
$str=preg_replace("/<(style.*?)>(.*?)<(/style.*?)>/si","",$str); //过滤style标签
 
$str=preg_replace("/<(/?style.*?)>/si","",$str); //过滤style标签
 
$str=preg_replace("/<(title.*?)>(.*?)<(/title.*?)>/si","",$str); //过滤title标签
 
$str=preg_replace("/<(/?title.*?)>/si","",$str); //过滤title标签
 
$str=preg_replace("/<(object.*?)>(.*?)<(/object.*?)>/si","",$str); //过滤object标签
 
$str=preg_replace("/<(/?objec.*?)>/si","",$str); //过滤object标签
 
$str=preg_replace("/<(noframes.*?)>(.*?)<(/noframes.*?)>/si","",$str); //过滤noframes标签
 
$str=preg_replace("/<(/?noframes.*?)>/si","",$str); //过滤noframes标签
 
$str=preg_replace("/<(i?frame.*?)>(.*?)<(/i?frame.*?)>/si","",$str); //过滤frame标签
 
$str=preg_replace("/<(/?i?frame.*?)>/si","",$str); //过滤frame标签
 
$str=preg_replace("/<(script.*?)>(.*?)<(/script.*?)>/si","",$str); //过滤script标签
 
$str=preg_replace("/<(/?script.*?)>/si","",$str); //过滤script标签
 
$str=preg_replace("/javascript/si","Javascript",$str); //过滤script标签
 
$str=preg_replace("/vbscript/si","Vbscript",$str); //过滤script标签
 
$str=preg_replace("/on([a-z]+)s*=/si","On\1=",$str); //过滤script标签
 
$str=preg_replace("/&#/si","&#",$str); //过滤script标签


上一篇 : tp5.1用GatewayWorker做一个简单的聊天室

下一篇 : TP5.1 查询数据库中上一条和下一条记录

-------------本文结束感谢您的阅读-------------

首页 技术分享

湘ICP备2021006798号

Copyright © 2021 狗林技术. All Rights Reserved.

友情链接: 测试链接

大家都在搜

  • 张三
  • 李四
  • 王二

关注我

微信号