【发布时间】:2017-11-12 05:50:14
【问题描述】:
我需要帮助,我只想将 href 链接替换为特定 div 类中的链接。
<div id="slider1" class="owl-carousel owl-theme">
<div class="item">
<div class="imagens">
<a href="http://oldsite.com/the-fate-of-the-furious"><img src="https://image.oldste.org" alt="The Fate of the Furious" width="100%" height="100%" /></a>
<span class="imdb">
<b class="icon-star"></b> N/A
</span>
</div>
<span class="ttps">The Fate of the Furious</span>
<span class="ytps">2017</span>
</div>
</div>
这里我想把http://oldsite.com/改成http://newsite.com/?id=
我想要这些 href 链接,例如
<a href="http://newsite.com/?id=the-fate-of-the-furious">
请帮我处理 preg_replace 正则表达式。
谢谢
【问题讨论】:
标签: replace preg-replace href