To detect a specific search engine crawler on your website you can use the $_SERVER['HTTP_USER_AGENT'] global and the list from http://www.useragentstring.com/pages/All/ in this way :
//example for google bot if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot")){ //take action .... } //example for yahoo! slurp if (strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "yahoo! slurp")){ //take action .... }