IMG_URL地址获取,正则解决思路

WBOY
Release: 2016-06-13 11:51:48
Original
1087 people have browsed it

IMG_URL地址获取,正则
大家。我请教一下,我怎么取到这里面的img地址:我想取得www.baidu.com

IMG_URL地址获取,正则解决思路


------解决方案--------------------
引用:
Quote: 引用:

$str = '<div class="float_l"><img  src="www.baidu.com"   style="max-width:90%" class="linkImg" link=abc" / alt="IMG_URL地址获取,正则解决思路" ></div>';<br />preg_match("/<img  src=\"([^\"]+)\"/i", $str,$match);<br / alt="IMG_URL地址获取,正则解决思路" >var_dump($match[1]);
Copy after login
如何把div也包含在里面??因为我页面上有很多的图片。。但是我只想取这个层里面的图片

IMG_URL地址获取,正则解决思路
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!