这个问题太逗了

浏览:434 发布日期:2013/11/20 分类:求助交流
同样的代码,如果写到action里边就没有问题。如果写到tpl里边就出错。写action里可以取得一个数组。。写tpl里就是空数组。开始以为是编码问题,把文件都重建了,还是一样结果。$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);
最佳答案
评论( 相关
后面还有条评论,点击查看>>