时间:2021-07-01 10:21:17 帮助过:28人阅读
|
专门用于提取网页所有超链接,邮箱及其它指定内容的php代码,供大家学习参考。
完整代码如下。
$value)
{
$rs[$key]=fetch_match_contents($value["begin"],$value["end"],$c);
if(is_array($th[$key]))
{ foreach($th[$key] as $old => $new)
{
$rs[$key]=str_replace($old,$new,$rs[$key]);
}
}
}
return $rs;
}
$url="http://www.yourdomain.com"; //要采集的地址
$ft["a"]["begin"]='
$ft["a"]["end"]='>'; //截取的结束点
$rs=pick($url,$ft,$th); //开始采集
print_r($rs["a"]);
?> |