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配置php-fpm启动参数及配置详解

约定几个目录 /usr/local/php/sbin/php-fpm/usr/local/php/etc/php-fpm.conf/usr/local/php/etc/php.ini一,...

php简单smarty入门程序实例

本文实例讲述了php简单smarty入门程序。分享给大家供大家参考。具体如下: 首先要有3个文件夹configs、templates、templates_c,在configs文件夹中有一...

PHP实现二维数组根据key进行排序的方法

本文实例讲述了PHP实现二维数组根据key进行排序的方法。分享给大家供大家参考,具体如下: 在PHP中内置了很多对数组进行处理的函数,有很多时候我们直接使用其内置函数就能达到我们的需求,...

PHP结合JQueryJcrop实现图片裁切实例详解

我们经常可以看到一些网站上有图片剪切的功能,或许你会觉得这一功能炫目华丽,神秘莫测!但是今天介绍的一款专用于图片裁切的插件jquery.Jcrop.min.js就将揭开图片剪切的神秘面纱...

php简单日历函数

php简单日历函数

本文实例讲述了php实现的日历程序。分享给大家供大家参考。具体如下: <?php /* * php 输出日历程序 */ header("Content-type...