I\'m making a hit counter. I have a database and I store the IP and $_SERVER[\'HTTP_USER_AGENT\']; of the visitors. Now I need to add a filter, so I can put awa
$_SERVER[\'HTTP_USER_AGENT\'];
And why not?
$bots=array('google', 'bing', 'yahoo', 'bot', 'crawler', 'baiduspider'); if(!preg_match('/('.join('|', $bots).')/is', $_SERVER['HTTP_USER_AGENT'])){ //record to db code }