PHP: Detect If It’s IE ?>

PHP: Detect If It’s IE

IE 11
IE 11

if  (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)) {
    header('Location: https://www.google.com/chrome/browser/desktop/');
}

Leave a Reply

Your email address will not be published. Required fields are marked *

20 − 14 =