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  exec("/bin/grep -r '$oldword' $rootpath", $results, $...

php XMLWriter类的简单示例代码(RSS输出)

复制代码 代码如下: include 'mysql.php'; $mysql= mysql::getObject(); $mysql->query("SELECT * FROM p...

PHP实现数组根据某个字段进行水平合并,横向合并案例分析

本文实例讲述了PHP实现数组根据某个字段进行水平合并,横向合并。分享给大家供大家参考,具体如下: PHP数组水平合并,横向合并,两条数据合并成一行 需求 将两个素组中日期相同的合并成一行...

php一些公用函数的集合

/*获得客户端ip地址*/     function getIP() {      &...

解析PHPExcel使用的常用说明以及把PHPExcel整合进CI框架的介绍

excel的写入与生成操作:复制代码 代码如下:include 'PHPExcel.php';include 'PHPExcel/Writer/Excel2007.php';//或者in...