请教$_SERVER['HTTP_USER_AGENT']能否发现百度蜘蛛
Jun 13, 2016 am 10:26 AM
请问$_SERVER['HTTP_USER_AGENT']能否发现百度蜘蛛?
我做了个网站想统计百度蜘蛛的访问情况,请问这个变量可以查到蜘蛛吗?如果不能用什么方法呢?
------解决方案--------------------
可以
if( strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'baiduspider') !== false ) {
//相关处理
}
------解决方案--------------------
嗯,这种问题直接去百度搜索的指引里看一下就好了:
http://www.baidu.com/search/spider.htm
------解决方案--------------------

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to install, uninstall, and reset Windows server backup

How to use Nginx Proxy Manager to implement automatic jump from HTTP to HTTPS

Understand common application scenarios of web page redirection and understand the HTTP 301 status code

Convert string to lowercase using PHP function 'strtolower'

Quick Application: Practical Development Case Analysis of PHP Asynchronous HTTP Download of Multiple Files
