试下$str='<a href="http://www.meimv.net/loc-1-32-p1.html" title="金山美女">金山 </a> <a href="http://www.meinv.net/loc-1-33-p1.html" title="上海美女">上海 </a>';preg_match_all("/loc-1-(\d+)-p1.html(.*?)>(.*?)\s*<\/a>/", $str, $matches);for ($i=0; $i< count($matches[0]); $i++) {
  echo $matches[1][$i]."\n";
  echo $matches[3][$i]."\n\n";
}

解决方案 »

  1.   

    $str = '<a href="http://www.meimv.net/loc-1-32-p1.html" title="金山美女">金山 </a> <a href="http://www.meinv.net/loc-1-33-p1.
    html" title="上海美女">上海 </a>';
    if (preg_match_all("/<a[^>]*loc-1-(\d+)[^>]*>([^>]*)</",$str,$m) ) {
        //print_r($m);
        $result[$m[1][0]] = $m[2][0];
        $result[$m[1][1]] = $m[2][1];
        print_r($result);
    }
      

  2.   

    preg_match_all("/loc-\d-(\d+)[^ ]+ title=\"[^\"]+\">([^ ]+)/",$str,$results);
    print_r($results[1]);
    print_r($results[2]);
      

  3.   

    ok,very good!
    好像我的回复迟了点