<li id="onlickImg" name="item-item-img-1" class="track">
<span class="SpriteSmallImgs" name="http://p4.vanclimg.com/product/0/1/9/0194233/small/0194233-0201303291751461604.jpg" style="background-image: url(//i.vanclimg.com/joinimages.ashx?d=/product/&href=0/1/9/0194233/small/0194233-0201303291751461604.jpg,0/1/9/0194233/small/0194233-1j201303011509563395.jpg,0/1/9/0194233/small/0194233-5y201303011509563395.jpg,0/1/9/0194233/small/0194233-6201303011509563395.jpg,0/1/9/0194233/small/0194233-8mc201303011509563395.jpg,0/1/9/0194233/small/0194233-8md201303011509563395.jpg,0/1/9/0194233/small/0194233-9201303011509563395.jpg);
background-position: 0px -0px"> </span> </li>php 正则
<span class="SpriteSmallImgs" name="http://p4.vanclimg.com/product/0/1/9/0194233/small/0194233-0201303291751461604.jpg" style="background-image: url(//i.vanclimg.com/joinimages.ashx?d=/product/&href=0/1/9/0194233/small/0194233-0201303291751461604.jpg,0/1/9/0194233/small/0194233-1j201303011509563395.jpg,0/1/9/0194233/small/0194233-5y201303011509563395.jpg,0/1/9/0194233/small/0194233-6201303011509563395.jpg,0/1/9/0194233/small/0194233-8mc201303011509563395.jpg,0/1/9/0194233/small/0194233-8md201303011509563395.jpg,0/1/9/0194233/small/0194233-9201303011509563395.jpg);
background-position: 0px -0px"> </span> </li>php 正则
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://item.vt.vancl.com/0194233.html");
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_USERAGENT, _USERAGENT_);
curl_setopt($ch, CURLOPT_REFERER,_REFERER_);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
preg_match("正则",$content,$img)然后我想获取网页中的商品图片,写了半天总是匹配不到商品的图片
我写了匹配id="onlickImg"这个了 然后总是匹配不到name的值
print_r($img[1]);