Looking for a better and affective PHP code to detect Search Engine Bots like google bot, Please need recommendation the code below is working perfect or any other code that perform much better then this?
function _bot_detected() {
return (
isset($_SERVER['HTTP_USER_AGENT'])
&& preg_match('/bot|crawl|slurp|spider|mediapartners/i', $_SERVER['HTTP_USER_AGENT']);
}
Regards