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+resumablejs实现的分块上传 断点续传功能示例

本文实例讲述了php+resumablejs实现的分块上传 断点续传功能。分享给大家供大家参考,具体如下: resumablejs官网 http://www.resumablejs.co...

php输出指定时间以前时间格式的方法

本文实例讲述了php输出指定时间以前时间格式的方法。分享给大家供大家参考。具体分析如下: 比如说你需要在php中输出3天前,20分钟以前,可以参考下面的代码 function ago...

php set_magic_quotes_runtime() 函数过时解决方法

把函数: set_magic_quotes_runtime($new_setting); 替换成: ini_set("magic_quotes_runtime", $new_settin...

php继承的一个应用

这样我 想到了继承来解决,前面发表过一个会话类,这下简单多了,通过登录来设置用户的级别,$session->get_status()的返回 值如果是0,则表明当前用户并不是博主,因...

PHP的数组中提高元素查找与元素去重的效率的技巧解析

提高查找数组元素的效率 1.php in_array方法说明 php查找数组元素是否存在,一般会使用in_array方法。 bool in_array ( mixed $needle...