21,886
社区成员
发帖
与我相关
我的任务
分享
$s =<<< TXT
<p>物品尺寸/规格:高24厘米,,好东西值得收藏。</p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157082579.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="1.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157109272.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="2.jpg"/></p><p><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157112075.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="3.jpg"/></p><p><br/></p>
TXT;
$s = preg_replace('#<img.+src=".+(/data/.+)".+/>#iU', '<a href="$1" target="_blank">$0</a>', $s);
<p>物品尺寸/规格:高24厘米,,好东西值得收藏。</p><p><a href="/data/attachment/antique//20141123/14167157082579.jpg" target="_blank"><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157082579.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="1.jpg"/></a></p><p><a href="/data/attachment/antique//20141123/14167157109272.jpg" target="_blank"><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157109272.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="2.jpg"/></a></p><p><a href="/data/attachment/antique//20141123/14167157112075.jpg" target="_blank"><img src="/ueditor/php/../../data/attachment/antique//20141123/14167157112075.jpg" style="max-width:700px;width:expression(this.width > 700? 700: true);" title="3.jpg"/></a></p><p><br/></p>