您现在的位置: 万盛学电脑网 >> 程序编程 >> 网络编程 >> php编程 >> 正文

php获取域名的google收录示例

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 这篇文章主要介绍了php获取域名的google收录具体实现,需要的朋友可以参考下

 代码如下: 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('/<div id=resultStats>[Ss].*<nobr>/Ui', $html,$index);  for($i=0;$i<=strlen($index['0']);$i++){  if(is_numeric($index['0'][$i])){  $count.=$index['0'][$i];  }  }  return $count;  }