当前位置:Gxlcms > PHP教程 > php获取域名的google收录示例_PHP教程

php获取域名的google收录示例_PHP教程

时间:2021-07-01 10:21:17 帮助过:6人阅读

代码如下:

function get_index($domain){
$url="http://www.google.com/search?source=hp&biw=1440&bih=762&q=site%3A$domain&aq=f&aqi=g10&aql=&oq=";
$html=file_get_contents($url);
preg_match('/[\S\s].*/Ui', $html,$index);
for($i=0;$i<=strlen($index['0']);$i++){
if(is_numeric($index['0'][$i])){
$count.=$index['0'][$i];
}
}
return $count;
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/745208.htmlTechArticle 代码如下:

function get_index($domain){ $url="http://www.google.com/search?source=hpbih=762aq=faql= $html=file_get_contents($url); preg_match('/div id=resultStats[\...

人气教程排行