May
23
2013
php统计搜索引擎访问记录
作者:
绝缘体.. 发布:
2013-05-23 10:28 分类:
未分类 阅读:
抢沙发
php统计搜索引擎访问记录,具体代码如下:
function get_naps_bot(){
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($useragent,'googlebot')!==false){
return 'Googlebot';
}
if(strpos($useragent,'msnbot')!==false){
return 'MSNbot';
}
if(strpos($useragent,'slurp')!==false){
return 'Yahoobot';
}
if(strpos($useragent,'baiduspider')!==false){
return 'Baiduspider';
}
if(strpos($useragent,'sohu-search')!==false){
return 'Sohubot';
}
if(strpos($useragent,'lycos')!==false){
return 'Lycos';
}
if(strpos($useragent,'robozilla')!==false){
return 'Robozilla';
}
return false;
}
微信扫一扫,打赏作者吧~