PHP determines whether it is reprinted by search engine spider

Source: Internet
Author: User

Introduction: This is a detailed page for PHP to determine whether a search engine is reprinted by a spider. It introduces PHP-related knowledge, skills, and experience, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 341727 'rolling = 'no'>/*** determine whether the search engine is a spider ** @ author Eddy * @ return bool */function iscrawler () {$ agent = strtolower ($ _ server ['HTTP _ user_agent ']); If (! Empty ($ agent) {$ spidersite = array ("tencenttraveler", "baiduspider +", "baidugame", "googlebot", "msnbot", "sososospider + ", "sogou web spider", "ia_archiver", "Yahoo! Slurp "," youdaobot "," yahoo slurp "," msnbot "," Java (often spam bot) "," baiduspider "," voila "," yandex bot ", "bspider", "twiceler", "sogou spider", "Speedy spider", "Google Adsense", "heritrix", "Python-urllib", "Alexa (IA archiver) "," Ask "," exabot "," custo "," outfoxbot/yodaobot "," yacy "," surveybot "," Legs "," lwp-trivial ", "nutch", "stackrambler", "The Web Archive (IA archiver)", "Perl tool", "m J12bot "," Netcraft "," msiecrawler "," wget Tools "," larbin "," Fish search ",); foreach ($ spidersite as $ Val) {$ STR = strtolower ($ Val); If (strpos ($ agent, $ Str )! = False) {return true ;}}else {return false ;}}

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/341727.html pageno: 6.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.