Answers for "php detect crawler"

PHP
0

php detect crawler

function is_web_crawler($user_agent) {
  return preg_match('/archiver|bot|crawl|slurp|spider|mediapartners/i',$user_agent);
}
$is_crawler = is_web_crawler($_SERVER['HTTP_USER_AGENT']);
Posted by: Guest on March-01-2021

Browse Popular Code Answers by Language