嗨,我想删除一个 img 标签,它的 src 是使用 preg_replace 的内容中的 url
前任。
$content = "<center><img src="http://example.net/wp-content/uploads/2012/10/cell-degeneration-contn.jpg" alt="" title="cell-degeneration-contn" width="950" height="272" class="alignnone size-full wp-image-100" /></center><h2>A first-in-class approach to stop & reverse </h2>";
所以输出将是:
$content="<center></center><h2>A first-in-class approach to stop & reverse </h2>";
但如果可能的话,最好的输出是:
$content="A first-in-class approach to stop & reverse ";