php采集入库_PHP教程
时间:2021-07-01 10:21:17
帮助过:24人阅读
if($_GET[id]<=70 && $_GET[id]){
$con=file_get_contents ("http://book.qq.com/lianzaiindex/sort4/index_".$_GET['id'].".htm");
//echo $con;
$preg = "#
(.*)#iUs";
preg_match_all($preg,$con,$arr);
$time=time();
foreach ($arr[1] as $k=>$v){
echo $v." ".$arr[2][$k]." ";
$sql="insert into tmp_url (url,title,addtime) values ('".$v."','".$arr[2][$k]."','$time')";
$db->query($sql);
}
$_GET['id']++;
echo "正在采集www.2cto.com。。。。".$_GET[id];
echo "";
}else {
echo "采集结束";
}
摘自 chaojie2009的专栏
http://www.bkjia.com/PHPjc/478391.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478391.htmlTechArticleif($_GET[id]=70 $_GET[id]){ $con=file_get_contents(http://book.qq.com/lianzaiindex/sort4/index_.$_GET[id]..htm); //echo $con; $preg = #tda href=\(.*)\ target=\_blank\strong(.*)/stro...
人气教程排行
|