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

相关文章

Linux Apache PHP Oracle 安装配置(具体操作步骤)

Oracle 就不说了,Linux 是 CentOS。1. 安装 httpd(apache)yum install httpd -y 2. 安装 php, php-gd, php-mcr...

php实现的统计字数函数定义与使用示例

本文实例讲述了php实现的统计字数函数定义与使用方法。分享给大家供大家参考,具体如下: <?php //函数定义: function countWords($str){...

PHP中array_keys和array_unique函数源码的分析

性能分析 从运行性能上分析,看看下面的测试代码: $test=array(); for($run=0; $run<10000; $run++) $test[]=rand(0,1...

PHP中设置时区,记录日志文件的实现代码

复制代码 代码如下:<html><body><?phpdate_default_timezone_set('Asia/Hong_Kong'); ...

收集的二十一个实用便利的PHP函数代码

PHP 是目前使用最广泛的基于 Web 的编程语言,驱动着数以百万计的网站,其中也包括如 Facebook 等一些大型站点。这里收集了 21 段实用便捷的 PHP 代码摘录,对每种类型的...