if (strpos($_SERVER[HTTP_USER_AGENT], 'Maxthon')) {
??? $browser = 'Maxthon';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'MSIE 8.0')) {
??? $browser = 'MSIE 8.0';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'MSIE 7.0')) {
??? $browser = 'MSIE 7.0';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'MSIE 6.0')) {
??? $browser = 'MSIE 6.0';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'NetCaptor')) {
??? $browser = 'NetCaptor';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'Netscape')) {
??? $browser = 'Netscape';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'Lynx')) {
??? $browser = 'Lynx';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'Opera')) {
??? $browser = 'Opera';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'Konqueror')) {
??? $browser = 'Konqueror';
} elseif(strpos($_SERVER[HTTP_USER_AGENT], 'Firefox')) {
??? $browser = 'Firefox';
} elseif(strpos($_SERVER[HTTP_USER_AGENT],'Safari')) {
??? $browser = 'Safari';
} else {
??? $browser = 'other';
}
echo $browser;
详细解决方案
php 获取浏览器姓名
热度:460 发布时间:2012-12-27 10:17:09.0
相关解决方案