如何删除 PHP 中的所有 HTML 标记,除了 <>
人物?
//There's other HTML tags, like h1, div, etc.
echo strip_tags('<gone with the wind> <p>a hotest book</p>');
这将返回 a hotest book
,但我需要保留书名。我需要函数返回 <gone with the wind> a hotest book
.
最佳答案
您应该考虑使用 <
(<) 和 &rt;
(>)。
关于除了 '<>'(书名)之外的 php 条标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14159940/