您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php 正则表达式获取网页所有网址和链接文字_PHP教程

2024/3/1 3:30:59发布26次查看
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.;
}
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...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product