我有些困惑,不知道如何处理这个问题。我有一个字符串看起来像这样...
$text = "<p>This is some example text This is some example text This is some example text</p>
<p><em>This is some example text This is some example text This is some example text</em></p>
<p>This is some example text This is some example text This is some example text</p>";
我基本上想要使用类似 preg_replace 和正则表达式来删除
<em>This is some example text This is some example text This is some example text</em>
我需要编写一些PHP代码,用于搜索开头的<em>
和结束的</em>
标签,并删除中间的所有文本。
希望有人能帮助, 谢谢。
<p>
元素吗? - Gordon