PHP技术分享-久趣源码交流论坛

PHP技术分享

久趣社区【PHP学院】--一个专注用于游戏或者源码里的PHP实用性社区!
帖子
56
互动
6
阅读
2727

PHP 获取百度和搜索收录量代码

今天在某个博客看到的,感觉加在侧边栏的统计区还可以,顺便发出来了

1
2
3
4
5
6
7
8
9
10
11
12
<?php 
function baiduSl($url){ 
 $baidu="http://www.baidu.com/s?wd=site:".$url
 $site=file_get_contents($baidu); 
 ereg("该网站共有(.*)个网页被百度收录"$site,$count); 
 $count=str_replace("该网站共有","",$count); 
 $count=str_replace("个网页被百度收录","",$count); 
 $count=str_replace(",","",$count); 
 $count=str_replace(" ","",$count); 
 return strip_tags($count[0]); 
?>

调用代码<?php echo baiduSl(‘www.9qys.com’);?>

具体怎么用我就不说了,你们自己看~

请登录后发表评论

    没有回复内容