请教$_SERVER['HTTP_USER_AGENT']能否发现百度蜘蛛

WBOY
Release: 2016-06-13 13:28:09
Original
1368 people have browsed it

请问$_SERVER['HTTP_USER_AGENT']能否发现百度蜘蛛?
我做了个网站想统计百度蜘蛛的访问情况,请问这个变量可以查到蜘蛛吗?如果不能用什么方法呢?

------解决方案--------------------
可以
if( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'baiduspider') !== false ) {
//相关处理
}
------解决方案--------------------
嗯,这种问题直接去百度搜索的指引里看一下就好了:

http://www.baidu.com/search/spider.htm
------解决方案--------------------

探讨

可以
if( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'baiduspider') !== false ) {
//相关处理
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!