涵盖了主要浏览器
//获取浏览器类型
function get_broswer()
{
//IE6
if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 6.0")){
$broswer="Internet Explorer 6.0";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 7.0")){
$broswer="Internet Explorer 7.0";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 8.0")) {
$broswer="Internet Explorer 8.0";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 9.0")) {
$broswer="Internet Explorer 9.0";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "MSIE 11.0")) {
$broswer="Internet Explorer 11.0";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "Edge")) {
$broswer="Edge";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "Chrome")){
$broswer="Google Chrome";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "Firefox")){
$broswer="Firefox";
}
else if (strpos($_SERVER["HTTP_USER_AGENT"], "Safari")){
$broswer="Safari";
}
else{
$broswer="other";
}
return $broswer;
}