PHP判断搜索引擎蜘蛛的代码
程序员文章站
2024-02-02 08:18:28
...
if(stripos($str,'msnbot')){ //msn
return false;
}
if(stripos($str,'Googlebot')){ //google
return false;
}
if(stripos($str,'Sosospider')){ //soso
return false;
}
if(stripos($str,'Sogou') && stripos($str,'spider')){ //Sogou
return false;
}
if(stripos($str,'yahoo') && stripos($str,'Slurp')){ //雅虎
return false;
}
if(stripos($str,'YodaoBot')){ //有道
return false;
}
if(stripos($str,'iaskspider')){ //爱问
return false;
}
return false;
}
if(stripos($str,'Googlebot')){ //google
return false;
}
if(stripos($str,'Sosospider')){ //soso
return false;
}
if(stripos($str,'Sogou') && stripos($str,'spider')){ //Sogou
return false;
}
if(stripos($str,'yahoo') && stripos($str,'Slurp')){ //雅虎
return false;
}
if(stripos($str,'YodaoBot')){ //有道
return false;
}
if(stripos($str,'iaskspider')){ //爱问
return false;
}
上一篇: 用PHP开发健壮的代码:高屋建瓴的介绍_PHP教程
下一篇: sql 创建触发器