您好,欢迎访问一九零五行业门户网

php删除字符串HTML标签的函数示例

//删除字符串中html标签//by bbs.it-home.orgfunction delete_htm($scr) { for($i=0;$i{ if(substr($scr,$i,1)=={ while(substr($scr,$i,1)!=>)$i++; $i++; } $str=$str.substr($scr,$i,1); } return($str); } ?>
复制代码
php如何去除html标签
方法1:直接取出想要取出的标记
复制代码
方法2.php 中有个 strip_tags 函数可以方便地去除 html 标签。echo strip_tags(“hello world”); // 去除 html、xml 以及 php 的标签。对于非标准的 html 代码也能正确的去除:echo strip_tags(“\”>cftea”); //输出 cftea
strip_tags函数去除html标签:
复制代码
其它类似信息

推荐信息