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;
}

相关文章

phpwind中的数据库操作类

<?php /*来源:phpwind.net*/ Class DB { var $query_num = 0; function&...

PHP几个数学计算的内部函数学习整理

round round - 对浮点数进行四舍五入。round 函数语法如下: round(float,precision) 其中参数 precision 表示小数点后面要保持的精度位数。...

PHP编程获取各个时间段具体时间的方法

本文实例讲述了PHP编程获取各个时间段具体时间的方法。分享给大家供大家参考,具体如下: <?php echo "今天:".date("Y-m-d")."<br&g...

php转换上传word文件为PDF的方法【基于COM组件】

本文实例讲述了php转换上传word文件为PDF的方法。分享给大家供大家参考,具体如下: 以前用过office组件转换上传文件word同时转换为html文件,这次要将word文件转换为p...

PHP对象实例化单例方法

PHP实例化对象单例的方法: 三私一公:2个私有方法,1个私有属性,1个公共方法   private function __construct(){} //不可以继承构造方法   p...