正则匹配 php取得网页上的所有链接
php取得网页上的所有链接 [代码片段(7行)]
<? function get_all_url($code){ preg_match_all('/<as+href=["|']?([^>"' ]+)["|']?s*[^>]*>([^>]+)</a>/i',$code,$arr); return array('name'=>$arr[2],'url'=>$arr[1]); } ?>
精彩图集
精彩文章
<? function get_all_url($code){ preg_match_all('/<as+href=["|']?([^>"' ]+)["|']?s*[^>]*>([^>]+)</a>/i',$code,$arr); return array('name'=>$arr[2],'url'=>$arr[1]); } ?>
@CopyRight 2002-2008, 1SOHU.COM, Inc. All Rights Reserved QQ:1010969229