【发布时间】:2016-11-19 03:35:31
【问题描述】:
<div class="media_embed" height="qqq" width="www">
<a href="http://giphy.com/gifs/dancing">via GIPHY</a>
<div class="media_embed" height="eee" width="rrr">
<a href="http://giphy.com/gifs/movie">via GIPHY</a>
我想这样做:
我必须从锚标签中获取 de href 并将其放在 img 标签之间并添加 figure 标签
<figure>
<img src="http://giphy.com/gifs/dancing" />
</figure>
<figure>
<img src="http://giphy.com/gifs/movie" />
</figure>
你能帮帮我吗
【问题讨论】:
-
不要使用正则表达式,使用解析器。
-
请标记我的回答以完成本次讨论。
标签: php html regex anchor href