AFAIK,
$_SERVER[\'REMOTE_HOST\'] should end up with \"google.com\" or \"yahoo.com\".
but is it the most ensuring method?
any other way out?
You are probably better off using $_SERVER['HTTP_USER_AGENT'] and look for Googlebot or Yahoo! Slurp.