跪求正则匹配出来下面的内容,研究很久无结果。
html代码内容如下:
<div class="brandItem-info">
<div class="bIi-brand j_BrandItemInfo ">
<p class="bIi-brand-logo">
<a target="_blank" href="http://evaouxiu.tmall.com"><img data-ks-lazyload="http://img02.taobaocdn.com/tps/i2/T1lXzTXdRoXXXQXDnq-90-45.png_120x120.jpg" height="45" width="90" alt="跪求正则匹配出来上面的内容,研究很久无结果" /></a>
<strong>Eva Ouxiu/伊华欧秀</strong>
</p>
<dl class="bIi-style clearfix">
<dt>品牌描述:</dt>
<dd>街头;通勤;女装;</dd>
</dl>
<p>月总销量:5702件</p>
<p class="bIi-intro j_BrandItemIntro">时尚商务生活方式的代表,适合帅气干练、优雅性感的都市女性穿着参加会议谈判、休闲聚会、宴会Party。</p>
</div>
<p class="bIi-addBtn">
<a class="ui-btn-m j_CollectBrand" data-brandId="95516990"> 关注该品牌</a> </p>
</div>
需要PHP正则把"<div class="brandItem-info">"开始到结束的内容匹配出来。
谢谢。
[最优解释]
preg_match('/<div class="brandItem-info">(.*)<\/div>/is',$str,$mat);
print_r($mat[1]);
啊?
[其他解释]
试了不行,因为忘记告诉你是上面代码是一个html中,后面还有很多内容。http://brand.tmall.com/categoryIndex.htm?industryId=110&categoryId=50031407&etgId=91&page=1 获取这个地址里面的品牌。信息
[其他解释]
正则答案:
preg_match_all('/<div class="brandItem-info">(.*?)<\/div>/ism',$content1,$mat);
print_r($mat);
感谢franzhong