1

What is the correct way to detect Internet Explorer in PHP, any version, including IE 11?

Tried:

f(!(isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || 
   strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))){

The above does not work for me.

alex
  • 1,300
  • 1
  • 29
  • 64
  • 1
    Have a look at http://stackoverflow.com/a/18070424/ (if you haven't already) see if that helps. There is some info about Trident in there. – Funk Forty Niner Mar 25 '15 at 15:54
  • possible duplicate of [PHP: If internet explorer 6, 7, 8 , or 9](http://stackoverflow.com/questions/5302302/php-if-internet-explorer-6-7-8-or-9) – wypieprz Mar 25 '15 at 17:39

1 Answers1

0

I found the get_browser_properties function on http://buffernow.com/get-browser-properties-without-browscap-in-php/ works for me

user1432181
  • 918
  • 1
  • 9
  • 24