php简单判断当前使用的是什么浏览器,判断浏览器类型的方法,方便统计网站访问用户使用浏览器的比例。
判断浏览器类型方法
1 function urbrowr() { 2 $ur_osagent = $_rver['http_ur_agent']; 3 4 if (strpos($ur_osagent, "maxthon") && strpos($ur_osagent, "msie")) { 5 $visitor_browr = "maxthon(microsoft ie)"; 6 } elif (strpos($ur_osagent, "maxthon 2.0")) { 7 $visitor_browr = "maxthon 2.0"; 8 } elif (strpos($ur_osagent, "maxthon")) { 9 $visitor_browr = "maxthon"; 10 } elif (strpos($ur_osagent, "msie 9.0")) { 11 $visitor_browr = "msie 9.0"; 12 } elif (strpos激活出错($ur_osagent, "msie 8.0")) { 13 $visitor_browr = "msie 8.0"; 14 } elif (strpos($ur_osagent, "msie 7.0")) { 15 $visitor_browr = "msie 7.0"; 16 } elif (strpos($ur_osagent, "msie 6.0")) { 17 $visitor_browr = "msie 6.0"; 18 } elif (strpos($ur_osagent, "msie 5.5")) { 19 $visitor_browr = "msie 5.5"; 20 } elif (strpos($ur_osagent, "msie 5.0")) { 21 $visitor_browr = "m单招啥意思sie 5.0"; 22 } elif (strpos($ur_osagent, "msie 4.01")) { 23 中国好声音选手 $visitor_browr = "msie 4.01"; 24 } elif (strpos($ur_osagent, "msie")) { 25 $visitor_browr = "msie 较高版本"; 26 } elif (strpos($ur_osagent, "netcaptor")) { 27 $visitor_browr = "netcaptor"网站不可点播; 28 } elif (strpos($ur_osagent, "netscape")) { 29 $visitor_browr = "netscape"; 30 } elif (strpos($ur_osagent, "chrome")) { 31 $visitor_browr = "chdox是什么意思rome"; 32 } elif (strpos($ur_osagent, "lynx")) { 33 $visitor_browr = "lynx"; 34 } elif (strpos($ur_osagent, "opera")) { 35 $visitor_browr = "opera"; 36 } elif (strpos($ur_osagent, "konqueror")) { 37 $visitor_browr = "konqueror"; 38 } elif (strpos($ur_osagent, "mozilla/5.0")) { 39 $visitor_browr = "mozilla"; 40 } elif (strpos($ur_osagent, "firefox")) { 41 $visitor_browr = "firefox"; 42 } elif (strpos($ur_osagent, "u")) { 43 $visitor_browr = "firefox"; 44 } el { 45 $visitor_browr = "其它"; 46 } 47 return $visitor_browr; 48 }
直接调用 urbrowr()
<?php echo "您现在使用的浏览器是:" . urbrowr();?>
本文转自: 转载请注明出处!
本文发布于:2023-04-07 19:03:05,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/7cfe15f4b8bbee545f42423fe8416eb8.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:PHP简单判断当前使用的是什么浏览器.doc
本文 PDF 下载地址:PHP简单判断当前使用的是什么浏览器.pdf
留言与评论(共有 0 条评论) |