-2

How can i detect any-IE in php , if any-ie then continue open page,

else non-ie this page can't open page then show error?

I'm using $_SERVER['HTTP_USER_AGENT'] to detect user's browser..

thx u lot.

1 Answers1

0
$browser = get_browser(null, true);
if($browser['browser'] != 'Internet Explorer') {
  die('Only IE');
}

See http://php.net/manual/en/function.get-browser.php

Mateusz Nowak
  • 4,021
  • 2
  • 25
  • 37
  • requires browsercap.ini, huge file, probably not worth it for this particular scenario. not saying it's not a viable solution – Ohgodwhy Oct 09 '14 at 09:58
  • If someone force users to use particular browser I think that he need one functionality that only this browser (at the moment) has. One can use `get_browser` to verify handling of this functionality in given browser. Of course there are simpler and faster ways to do that, for instance plain regexp but this should resolve all the problems. Anyway, thanks for pointing out requirements that I've forgotten. – Mateusz Nowak Oct 09 '14 at 10:04
  • yes, i can't use it, mush include browscap.ini ...-_-. – Asuka Sb Oct 09 '14 at 10:36