最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 过滤所有HTML标记
时间:2022-06-24 20:17:29 编辑:袖梨 来源:一聚教程网
//去除html标记
代码如下 | 复制代码 |
function text2html($txt){ $txt = str_replace(" "," ",$txt); $txt = str_replace("<","<",$txt); $txt = str_replace(">",">",$txt); $txt = preg_replace("/[ ]{1,}/isu"," ",$txt); return $txt; } |
//清除html标记
代码如下 | 复制代码 |
function clearhtml($str){ $str = str_replace('<','<',$str); $str = str_replace('>','>',$str); return $str; } |
相关文章
- 绝区零奥菲丝值得抽吗-奥菲丝鬼火抽取建议 09-16
- 逆战未来霰弹枪怎么选择 09-16
- 为了吾王红装有什么获取途径 09-16
- 尤雅时光怎么玩 09-16
- 背包乱斗福西法的宝藏如何获得 09-16
- 新三国志曹操传关羽角色有什么技能 09-16