8516830 发表于 2018-12-22 06:05:17

php去除、去掉html标签函数strip_tags

  php 中有个 strip_tags 函数可以方便地去除 HTML 标签。

echo strip_tags($html); // 去除 $html 中的 HTML、XML 以及 PHP 的标签。
例如:$html = 'www.anddd.com';
echo strip_tags($html);//将会输出www.anddd.com
对于非标准的 HTML 代码也能正确的去除:
echo strip_tags(''); //输出 www.anddd.com



页: [1]
查看完整版本: php去除、去掉html标签函数strip_tags