日期:2014-05-16 浏览次数:20421 次
<html>
<body>
.........
.........
<ul class="style5">
<li><a href="/profiles/83291221"><img src="/images/252754752" alt="标题标题" />标题标题</a></li>
<li><a href="/profiles/83291221"><img src="/images/252754752" alt="标题标题" />标题标题</a></li>
<li><a href="/profiles/83291221"><img src="/images/252754752" alt="标题标题" />标题标题</a></li>
</ul>
........
........
</body>
</html>
preg_match_all("
------解决方案--------------------
<li><a href=[\"\']\/(.*)\/(.*)[\"\']><img(.*)>(.*)</a></li>
------解决方案--------------------
U", $str, $out);
$a = $out[2][0];
$b = $out[4][0];
echo "a::$a , b::$b";
preg_match('#<ul class="style5">(.+?)</ul>#s',$s,$m);
preg_match('#<li><a href="/profiles/(\d+)"><img[^>]+>(.+?)</a></li>#s',$m[1],$ar);
print_r($ar);