Home > Backend Development > PHP Tutorial > php判断来访蜘蛛信息的函数

php判断来访蜘蛛信息的函数

WBOY
Release: 2016-06-20 13:02:23
Original
1246 people have browsed it

php判断来访蜘蛛的信息的函数,具体代码如下:

<p>function get_naps_bot(){</p>	$useragent=strtolower($_SERVER['HTTP_USER_AGENT']);<br />	if(strpos($useragent,'googlebot')!==false){<br />		return 'Googlebot';<br />	}<br />	if(strpos($useragent,'msnbot')!==false){<br />		return 'MSNbot';<br />	}<br />	if(strpos($useragent,'slurp')!==false){<br />		return 'Yahoobot';<br />	}<br />	if(strpos($useragent,'baiduspider')!==false){<br />		return 'Baiduspider';<br />	}<br />	if(strpos($useragent,'sohu-search')!==false){<br />		return 'Sohubot';<br />	}<br />	if(strpos($useragent,'lycos')!==false){<br />		return 'Lycos';<br />	}<br />	<br />	if(strpos($useragent,'robozilla')!==false){<br />		return 'Robozilla';<br />	}<br />	return false;<br />}
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template