我有一个 php 文件:
$content = str_replace('search old string','by new string',$content);
$content = str_replace('search old string','by new string',$content);
它适用于搜索和替换或删除字符串。但是如果旧字符串是一个段落,例如:
<table class="adverting_I_want_to_remove">
<tr>
<td>Dynamic Advertise content 1</td>
<td>Dynamic Advertise content 2</td>
</tr>
</table>
如何在内容中删除该表?