• 【php】 检测 ie ie11 edge浏览器


    来源 php.net 官网评论截取

    -- Declan kelly

    Please note that Internet Explorer 11 no longer contains MSIE in its user agent string, for example on Windows 8 with IE11 I get the following:

    Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

    So if you want to include a test for IE11, the code above changes to: 

    <?php
    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE ||
        strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== FALSE) {
        echo 'You are using Internet Explorer.<br />';
    }
    ?>

    -- Bilal.S

    On Edge, the user agent string does not contain 'MSIE' neither 'Trident', but rather 'Edge'.

    建议使用者亲测,我自测结果和上述有点不一样,因为WIN7电脑不能安装EDGE,所以我是用调试平台调试的,具体情形需浏览人员自行甄别

  • 相关阅读:
    Go Map
    Go XORM
    Go切片
    Go函数
    dockerfile常用指令
    Goroutine并发控制
    Go 格式转换
    Go 常用知识点及实例
    Go 时间
    Go error
  • 原文地址:https://www.cnblogs.com/china-flint/p/9582592.html
Copyright © 2020-2023  润新知