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 urlencode()与urldecode()函数字符编码原理详解

php urlencode()与urldecode()函数字符编码原理详解

其原理就是把中文字符转换为十六进制并按某种规则进行字符串组合,实现字符的编码与解编码,保证URL数据传递过程中字符的完整性和兼容性,主要讨论中文字符的编码情况。 一,FireFox浏览器...

PHP 获取某年第几周的开始日期和结束日期的实例

实例如下所示: /** * 获取某年第几周的开始日期和结束日期 * @param int $year * @param int $week 第几周; */ pub...

PHP中大于2038年时间戳的问题处理方案

PHP有效的时间戳典型范围是格林威治时间 1901 年 12 月 13 日 20:45:54    到 2038 年 1 月 19 日 03:14:07。(...

PHP 无限分类三种方式 非函数的递归调用!

PHP 无限分类三种方式 非函数的递归调用!

php无限分类大致有三种方式,   1、数据库通过设置父类ID来进行唯一索引,然后使用函数的递归调用实现无限分类;   2、数据库设计通过特定格式进行排列,然后使用mysql查询关键函数...

解析PHP可变函数的经典用法

复制代码 代码如下:<?phpfunction map($fun, $list,$params=array()){    $acc=NULL;&nbs...