HTTP_USER_AGENT Spider check

$botchar = “/(Googlebot|YahooSeeker|mediapartners|baiduspider|sohu-search|soso|spider|sohu-search|yodao|robozilla|msnbot)/i”; //add yourself
if(preg_match($botchar, $_SERVER[‘HTTP_USER_AGENT’]))
reutrn true;
else
return false;