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在字符断点处截断文字的实现代码

复制代码 代码如下: //所谓断字 (word break),即一个单词可在转行时断开的地方。这一函数将在断字处截断字符串。 // Please acknowledge use of t...

php下实现一个阿拉伯数字转中文数字的函数

如果要用于金额的转换,对小数部分的处理要做一下修改 <?php function ch_num($num,$mode=true) { $char =&...

详解WordPress开发中的get_post与get_posts函数使用

get_post() 在一般主题制作时,get_post()函数我们一般很少会用到,但因为后面会讲到get_posts(),所以我们不得不先讲一下这个单数形式。这个函数的主要作用是,将...

php 修改、增加xml结点属性的实现代码

php 修改 增加xml结点属性的代码,供大家学习参考。php修改xml结点属性,增加xml结点属性的代码,有需要的朋友,参考下。 1、xml文件 复制代码 代码如下:<?xml...

div li的多行多列 无刷新分页示例代码

div li的多行多列 无刷新分页示例代码

翻页文件一次加载了全部的内容,因而不是很适合大型的网站,而适用于数据比较少的情况。 本例未使用数据库。  PHP Code 复制代码 代码如下: <div class="...