php教程 正則表達式獲取網頁所有網址和鏈接文字
$url ='http://www.bKjia.c0m';
$body=@file_get_contents($url);
preg_match_all('/href=['"]?([^'"]*)['"]?>(.*)/i',$body,$b);
$nums = array();
foreach($b[1] as $u){
if(in_array($u,$nums)){
continue;
}
$nums[]=$u;
$title=strip_tags($u);
echo $title."</br>";
}