作者:幽默的人生就是悲催基_129 | 来源:互联网 | 2018-07-17 03:56
提供一款查询收录时常用的google正则表达式功能哦,我们是取得内容然后再正则出我们想要的内容,再在本地输出。
$TheUrl="http://www.google.cn/search?q=+site:".$q."&num=20&complete=1&hl=zh-CN&lr=&newwindow=1&as_qdr=".$t."&start=".$p."&sa=N";
$TheThie=GetPage($TheUrl);
}
$TheBody=GetContent($TheThie,"
","
$TheBody=iconv( "UTF-8", "gb2312//IGNORE" , $TheBody);
$TheBody=str_replace("
","",$TheBody);
$TheBody=str_replace('
','
',$TheBody);
$TheBody=preg_replace('','a href=?q=$3&t=$2&p=$4>
$TheBody=str_replace("该网站可能含有恶意软件,有可能会危害您的电脑。","",$TheBody);
$TheBody=str_replace("/interstitial?url=","",$TheBody);
$TheBody=str_replace("- ","",$TheBody);
$TheBody=str_replace("类似网页","",$TheBody);
$total=GetContent($TheThie,"
"," - ");
$total=iconv( "UTF-8", "gb2312//IGNORE" , $total);
$total=GetContent($total,"有 "," 项");
$total=str_replace("有 ","",$total);
$total=str_replace(",","",$total);
$total=intval($total);