ホームページ  >  記事  >  php教程  >  php获取域名的google收录示例

php获取域名的google收录示例

WBOY
WBOYオリジナル
2016-06-13 09:40:161074ブラウズ

复制代码 代码如下:


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;$iif(is_numeric($index['0'][$i])){
$count.=$index['0'][$i];
}
}
return $count;
}
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。