php获取域名的google收录示例

yipeiwu_com6年前PHP代码库
复制代码 代码如下:

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>[\S\s].*<nobr>/Ui', $html,$index);
for($i=0;$i<=strlen($index['0']);$i++){
if(is_numeric($index['0'][$i])){
$count.=$index['0'][$i];
}
}
return $count;
}

相关文章

PHP 实现页面静态化的几种方法

1、通过buffer来实现 需要用file_put_contents ob_get_clean()等内置函数 ob_start (); include "filterpost.htm...

PHP取余函数介绍MOD(x,y)与x%y

取余函数 PHP取余函数 PHP两个取余 MOD(x,y) x%y MOD 例如:9/3,9是被除数,3为除数.mod函数是一个求余函数,其格式为: mod(nExp1,nExp2),...

UCenter Home二次开发指南

前言本文将就UCH二次开发这个核心主题,以各种实现的代码为主,辅助部分说明概略的讲解如何针对UCH进行二次开发。过段时间UCH就开源了,准备到时候再详细的写篇UCH机制分析。 顺便说下,...

php自定义扩展名获取函数示例

本文实例讲述了php自定义扩展名获取函数。分享给大家供大家参考,具体如下: <?php $url = "http://www.abc.com/abc/de/fg.php...

php array_merge下进行数组合并的代码

如  $array3=array("性别"=>"男","姓名"=>"不是女人");  $array4=array("性别"=>"不知道","长相"=...