Skip to content

Instantly share code, notes, and snippets.

@RLHawk1
RLHawk1 / crawler_detect.php
Last active January 17, 2017 16:41 — forked from geerlingguy/crawler_detect.php
Detect crawlers/bots/spiders in PHP (simple and fast)
<?php
/**
* Check if the user agent string is one of a crawler, spider, or bot.
*
* @return bool
* TRUE if the user agent is a bot, FALSE if not.
*/
function is_crawler() {
// User lowercase string for comparison.