1. 当前位置:网站首页 > 技术分享 > php

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

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

<?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.90175.com');?>

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


本文由网上采集发布,不代表我们立场,转载联系作者并注明出处:https://www.90175.com/wenku/txtlist_i104v.html

联系我们

在线咨询:点击这里给我发消息

微信号:76891828

工作日:9:30-18:30,节假日休息