Detecting IE browser version using PHP
问题 I'm using $_SERVER['HTTP_USER_AGENT'] to detect user's browser. When I run the var_dump on my localhost on IE8 it returns: ...compatible; MSIE 8.0; ... But when I upload it to my host (godaddy), I get: ...compatible; MSIE 7.0; ... What's the problem? 回答1: Check for the word TRIDENT in the string. The compatibility-thing is ie in compatibility-mode. Google it if you want to know what it means. However, the term trident is only ie8+. Edit: Also, you can set a headder/meta-tag to force ie8-mode