php获取域名的google收录示例

yipeiwu_com5年前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设计模式 Delegation(委托模式)

复制代码 代码如下: <?php /** * 委托模式 示例 * * @create_date: 2010-01-04 */ class PlayList { var $_song...

PHP 事件机制(2)

复制代码 代码如下: <?php class Event extends stdClass{ public $target=null; public $type=null; /**...

php模块memcache和memcached区别分析

1.目前大多数php环境里使用的都是不带d的memcache版本,这个版本出的比较早,是一个原生版本,完全在php框架内开发的。与之对应的带d的memcached是建立在libmemca...

PHP Swoole异步读取、写入文件操作示例

PHP Swoole异步读取、写入文件操作示例

本文实例讲述了PHP Swoole异步读取、写入文件操作。分享给大家供大家参考,具体如下: 异步读取文件:swoole_async_readfile 异步写入文件:swoole_asyn...

使用PHPWord生成word文档的方法详解

本文实例讲述了使用PHPWord生成word文档的方法。分享给大家供大家参考,具体如下: 有时我们需要把网页内容保存为Word文档格式,以供其他人员查看和编辑。PHPWord是一个用纯P...