时间:2021-07-01 10:21:17 帮助过:2人阅读
$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."";
}
http://www.bkjia.com/PHPjc/631998.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/631998.htmlTechArticlephp教程 正则表达式获取网页所有网址和链接文字 $url ='http://www.111cn.net'; $body=@file_get_contents($url); preg_match_all('/href=[']?([^']*)[']?(.*)/i',$body,$b...