如何用PHP编写代码去除网页中的HTML标签?

更新于
2026-09-27 21:09:11
0阅读来源:SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计57个文字,预计阅读时间需要1分钟。

如何用PHP编写代码去除网页中的HTML标签?

php

如何用PHP编写代码去除网页中的HTML标签?

<? function Text2Html($txt){ $txt = str_replace(" "," ",$txt); $txt = str_replace("<","&lt;",$txt); $txt = str_replace(">","&gt;",$txt); $txt = preg_replace("/[rn]{1,}/isU"," rn",$txt); return $txt; } ?>