php正则表达式获取第一张图片_src里面的网址并过滤 10
请问怎样获取第一张图片的_src里面的网址并且去掉后面的_320x320.jpg代码如下:<divclass="bd"><ul><li><ahref="#"><img_s...
请问怎样获取第一张图片的_src里面的网址并且去掉后面的_320x320.jpg
代码如下:
<div class="bd">
<ul>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i1/T18gtTFwRxXXXXXXXX_!!0-item_pic.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i2/1102773628/T2eWYcXbJaXXXXXXXX_!!1102773628.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i2/13628023026646270/T1tmKGXEXaXXXXXXXX_!!0-item_pic.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i1/1102773628/T2y5PTXhXaXXXXXXXX_!!1102773628.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
</ul>
</div> 展开
代码如下:
<div class="bd">
<ul>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i1/T18gtTFwRxXXXXXXXX_!!0-item_pic.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i2/1102773628/T2eWYcXbJaXXXXXXXX_!!1102773628.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i2/13628023026646270/T1tmKGXEXaXXXXXXXX_!!0-item_pic.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
<li><a href="#"><img _src="http://gw.alicdn.com/bao/uploaded/i1/1102773628/T2y5PTXhXaXXXXXXXX_!!1102773628.jpg_320x320.jpg" src="static/images/blank.png" /></a></li>
</ul>
</div> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询