PHPCMS v9过滤采集内容中CSS样式的实现方法


本文整理自网络,侵删。

方法如下:

  1、找到\phpcms\libs\functions\global.func.php 打开,然后添加函数


代码如下:

function htmrp($str) {
$str = preg_replace("/<script[^>]*>/i", "", $str);
$str = preg_replace("/<\/script>/i", "", $str);
$str = preg_replace("/<iframe[^>]*>/i", "", $str);
$str = preg_replace("/<\/iframe>/i", "", $str);
$str = preg_replace("/<style[^>]*>/i", "", $str);
$str = preg_replace("/<\/style>/i", "", $str);
$str = preg_replace("/<div[^>]*>/i", "", $str);
$str = preg_replace("/<\/div>/i", "", $str);
return $str;
}

阅读剩余部分

相关阅读 >>

phpcms自定义碎片插件之内容碎片标签模块使用方法

国内一些常用php的cms的nginx服务器的伪静态规则整理

phpcms v9调用自定义字段的方法

phpcms 模板安装导入教程

建站常用13种php开源cms比较

phpcms数据库管理设置教程 如何设置phpcms数据库

十二个常见的php+mysql类免费cms系统

phpcms 栏目页及列表页分页修改

phpcms遭遇会员投稿审核无效的解决方法 font color=red原创font

phpcms 2008 sp3 模板语法规则整理

更多相关阅读请进入《phpcms》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...