私はあなたのために配列を作りました。googlebot、yahoo、yandex などのお気に入りのボットがあります。必要に応じて、カンマで区切られた一重引用符内の Crawlerlist 配列にユーザー エージェントを配置することで、追加のユーザー エージェントを追加することもできます。
ここで利用可能なすべての UserAgent のリストを取得できます: http://www.useragentstring.com/pages/Crawlerlist/
$UserAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
$Crawlerlist = array('googlebot', 'yahoo','yandex');
$pattern = '/('.implode('|', $Crawlerlist).')/';
if(preg_match($pattern,$UserAgent))
echo "Do something on the Website when either one of above 3 bots are matched";
else
echo "Do Nothing when Not matched";
これがお役に立てば幸いです。これは、Stack Overflow での最初の回答です。