Home > Backend Development > PHP Tutorial > php collection and storage_PHP tutorial

php collection and storage_PHP tutorial

WBOY
Release: 2016-07-13 17:48:52
Original
1034 people have browsed it

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 "<script>location.href='stahtml.php?id=".$_GET[id]."'</script>"; 
}else { 
    echo "采集结束"; 


摘自 chaojie2009的专栏

www.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=_blankstrong(.*)/stro...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template