Detect IE compatibility mode only with PHP

Is it possible to detect that IE is in useragent compatibility mode with PHP ?

I am using IE10 and have useragent

Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)

Thus, it appears as Internet Explorer 7.

Of course, it would be a bad idea to rely only on such PHP detection, but it is very useful for some ocasions (for example, registering with PHP or debugging hints, ...)

+1
source share
2 answers

From this resource: http://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx

IE 10 , IE 7, Trident/6.0, IE 10 .

PHP, Trident/6.0.

Internet Explorer Trident: IE9 Trident/5.0, IE 8 Trident/4.0, IE 7 Trident .

$_SERVER['HTTP_USER_AGENT']. .

IE10:

  • : Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
  • : Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; Trident/6.0)

, MSIE , Trident . , .

+5

, .

-, , - IE. UA , UA, IE-, .

-, (.. ) (.. ) dev; IE8, IE10.

, UA - ; , , .

. IE, , ; . , , , X-UA-Compatible.

, ; , . , IE10.

+2

Source: https://habr.com/ru/post/1754036/


All Articles