I do not allow suspicious bots to the site, I wrote a small script, but it doesn’t look very good, maybe there is another way to iterate through the array?
$user_agent = $_SERVER['HTTP_USER_AGENT']; $bot = array("MJ12bot","MSIE","AhrefsBot"); for ($i = 0; $i <= 2; $i++){ $check = strripos($user_agent, $bot[$i]); if ($check === false) { echo " "; } else { die('Боты, валите отсюда!'); } }