【发布时间】:2012-08-01 19:17:57
【问题描述】:
我想要做的是专门为 IE9 制作一个 PHP Conditional。到目前为止我尝试过的是这两个 PHP 浏览器条件
if(preg_match('/(?i)msie [9]/',$_SERVER['HTTP_USER_AGENT']))
{
//my code here
exit;
}
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)
{
//my code here
}
我写错了吗?我错过了什么吗?
【问题讨论】:
-
我会改用条件 cmets。必须承认,虽然我从来不需要我们的 9 的特定代码。
-
您能否详细说明您为什么要专门针对 ie9?可能有替代解决方案。
-
或者你可以使用get_browser()
-
我专门针对 IE9 来修复一些在 PHP 文件中编码的边框。
标签: php internet-explorer browser internet-explorer-9 conditional