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 excel类 phpExcel使用方法介绍

下载地址:http://www.codeplex.com/PHPExcel   下面是总结的几个使用方法   include ‘PHPExcel.php';   include ‘PHP...

PHP三层结构(下) PHP实现AOP第1/2页

PHP三层结构(下) PHP实现AOP第1/2页

本文源码下载地址:http://xiazai.jb51.net/201007/yuanma/TraceLWord.rar 开发环境为 eclipse(pdt) 让我们把注意力集中到中间服...

关于页面优化和伪静态

关于页面优化和伪静态 1)版面优化 2)伪静态(重点涉及apache,smarty,正则) 详细内容: 一、版面优化: 版面优化其实主要涉及HTML,JS,CSS,XML之间的关系(XM...

PHP 5.3新增魔术方法__invoke概述

PHP自从5.3版以来就新增了一个叫做__invoke的魔术方法,使用该方法就可以在创建实例后,直接调用对象。如下示例所示: class testClass { public fun...

限制ckeditor上传图片文件大小的方法

一种可以通过修改PHP.INI配置文件上传大小来限制,另一种方法只能手动修改Fckeditor源码,方法如下打开editor/filemanager/connectors/php目录下c...