Home > php教程 > php手册 > body text

PHP判断搜索引擎蜘蛛的代码

WBOY
Release: 2016-06-21 08:57:24
Original
1125 people have browsed it

if(stripos($str,'msnbot')){ //msn
         return false;
       }
       if(stripos($str,'Googlebot')){ //google
         return false;
       }
       if(stripos($str,'Sosospider')){ //soso
         return false;
       }
       if(stripos($str,'Sogou') && stripos($str,'spider')){ //Sogou
         return false;
       }
       if(stripos($str,'yahoo') && stripos($str,'Slurp')){ //雅虎
         return false;
       }
       if(stripos($str,'YodaoBot')){ //有道
         return false;
       }
       if(stripos($str,'iaskspider')){ //爱问
         return 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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template