用PHP重定向Firefox浏览器


Redirect Firefox web browser in PHP

如何阻止/重定向web浏览器从一个网站在PHP,我已经尝试使用这个代码,

<?php
$userAgent = $_SERVER['HTTP_USER_AGENT'];
return (stripos($userAgent, 'Firefox') !== FALSE);
?> 

是否有其他方法将浏览器重定向到另一个页面?谢谢。

您可以测试用户代理,如果是firefox,则重定向....就像

if (isset($_SERVER['HTTP_USER_AGENT'])) {
    $agent = $_SERVER['HTTP_USER_AGENT'];
    if (strlen(strstr($agent, 'Firefox')) > 0) {
        header("Location: http://www.google.com:);
        exit;
    }
}