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

PHP技术分享

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

PHP 获取搜狗收录量代码

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

1
2
3
4
5
6
7
8
9
10
11
12
<?php 
function sogouSl($url){ 
 $sogou="http://www.sogou.com/web?query=site:".$url
 $site=file_get_contents($sogou); 
 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 sogouSl(‘www.9qys.com’);?>

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

请登录后发表评论

    没有回复内容