判断浏览器类型PHP版

判断浏览器类型的方法有很多,今天分享一个比较简单的:判断浏览器类型PHP版

<?php
echo "您的浏览器类型是: ";
if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 8.0"))
    echo "Internet Explorer 8.0"; //这里可以写其他的执行命令
else if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 7.0"))
    echo "Internet Explorer 7.0";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"MSIE 6.0"))
    echo "Internet Explorer 6.0";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"Firefox/3"))
    echo "Firefox 3";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"Firefox/2"))
    echo "Firefox 2";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"Chrome"))
    echo "Google Chrome";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"Safari"))
    echo "Safari";
else if(strpos($_SERVER["HTTP_USER_AGENT"],"Opera"))
    echo "Opera";
else echo $_SERVER["HTTP_USER_AGENT"];
?>