正则改为懒惰模式

This commit is contained in:
wlx 2011-12-03 05:48:15 +00:00
parent 7bb495748a
commit ca027fa17b
1 changed files with 1 additions and 1 deletions

View File

@ -1029,7 +1029,7 @@ class ServiceController extends Zend_Controller_Action
$error = "无搜索结果"; $error = "无搜索结果";
} }
if(preg_match_all("!<span class=gs_a>(.*)<\/span>!im",$html,$matchs,PREG_PATTERN_ORDER)) if(preg_match_all("!<span class=gs_a>(.*?)<\/span>!im",$html,$matchs,PREG_PATTERN_ORDER))
{ {
foreach ($matchs[0] as $k=>$v){ foreach ($matchs[0] as $k=>$v){
if($k < $max) $rev[$k]['content']=utf8_encode($v); if($k < $max) $rev[$k]['content']=utf8_encode($v);