if (isset($_SERVER['HTTP_USER_AGENT'])){ $agent = descript($_SERVER['HTTP_USER_AGENT']); $nbot = array("yandex", "google", "msnbot", "bingbot", "mail", "yahoo", "rambler", "aport", "webcrawler", "webalta"); for ($i = 0, $c_i = sizeof($nbot); $i <= $c_i; $i++) { if (stripos($agent, $nbot[$i]) !== false) { $bot = "bot"; break; } else { $bot = "browser"; } } } else { $bot = "Unknown"; }