PHP获取浏览器类型及版本号
function getBrowser(){ $agent=$_SERVER["HTTP_USER_AGENT"]; if(strpos($agent,'MSIE')!==false || strpos($agent,'rv:11.0')) //ie11判断 return "ie"; else if(strpos($agent,'Firefox')!==false) return "firefox"; else if(strpos($agent,'Chrome')!==false) return "chrome"; else if(strpos($agent,'Opera')!==false) return 'opera'; else if((strpos($agent,'Chrome')==false)&&strpos($agent,'Safari')!==false) return 'safari'; else return 'unknown'; } function getBrowserVer(){ if (empty($_SERVER['HTTP_USER_AGENT'])){ //当浏览器没有发送访问者的信息的时候 return 'unknow'; } $agent= $_SERVER['HTTP_USER_AGENT']; if (preg_match('/MSIE\s