如何删除任何html标签,除了它们之间只有可选的空格

Eri*_*ric 0 html php regex

我需要一遍又一遍地清理一些非常难看的HTML(想想<span> </ span> <em> </ em> <em> </ em> <strong> </ strong>)......

我正在寻找一个简单易用的preg_replace来消除任何包含它们之间可选空格的html标签.非常感谢您的帮助!

哦,刚发现这个美女:

<p> <strong> <strong> </ strong> </ strong> </ p>

看起来这也需要在while循环中生存.

Pet*_*ley 5

这个主题如何不断出现很有趣.

不要使用正则表达式.请尝试HTML Tidy.