$zhengze="/^(\d+\ \S+\ \d+\/\d+\ \S+)\ ?(<a[^>]+\S+)?\ ?(<a[^>]+\S+)?\ ?(<a[^>]+\S+)?\ *(<a[^>]+\S+)?\ *((<[^>]+\S+\ *){0,5})\ *(<a[^>]+\S+)?\ *(<a[^>]+\S+)?$/";
preg_match($zhengze,"2522 条记录 1/127 页 <a href='/jz/index.php?s=/Index/zb/p/2.html'>下一页</a> <span class='current'>1</span><a href='/jz/index.php?s=/Index/zb/p/2.html'>2</a><a href='/jz/index.php?s=/Index/zb/p/3.html'>3</a><a href='/jz/index.php?s=/Index/zb/p/4.html'>4</a><a href='/jz/index.php?s=/Index/zb/p/5.html'>5</a> <a href='/jz/index.php?s=/Index/zb/p/6.html' >下5页</a> <a href='/jz/index.php?s=/Index/zb/p/127.html' >最后一页</a>", $matches);
//echo $list[1];
unset($matches[0]);unset($matches[7]);
foreach($matches as $v){
//echo '<li>'.$v.'</li>';
}
var_export($matches); 最佳答案