【问题标题】:How to detect ANY Internet Explorer in PHP? [duplicate]如何在 PHP 中检测任何 Internet Explorer? [复制]
【发布时间】:2014-04-29 15:02:20
【问题描述】:

问题是,如何使用 PHP 检测任何 IE 版本?

我看到检测特定 IE 版本的 PHP 脚本,但我无法找到检测 任何 版本 IE 的方法。感谢您的帮助。

【问题讨论】:

  • 所有的概念都是一样的。而且,你为什么还要这样做?
  • khm-khm包括IE11
  • 建议:不要这样做。只是接受浏览器有其怪癖。如果您绝对需要以 IE 为目标,请使用conditional comments。针对浏览器进行特殊处理,麻烦多于其价值。

标签: php internet-explorer


【解决方案1】:
<?php
function ae_detect_ie()
{
    if (isset($_SERVER['HTTP_USER_AGENT']) && 
    (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
        return true;
    else
        return false;
}
?>

取自:http://www.anyexample.com/programming/php/how_to_detect_internet_explorer_with_php.xml

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-16
    • 2015-05-29
    • 2019-11-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多