4 ms·
An Easy Way To Check For IE in PHP
- byoung2 13y agoBrowser sniffing is a bad idea, because it is unreliable and difficult to maintain. Users can change their UA, and it is possible that a full-featured browser will use a UA string that inadvertently matches your regexp (e.g. a WebKit browser with the useragent "NOT MSIE 9.0, NOT Trident"). It may also be possible (however unlikely) to add in the missing functionality in older Internet Explorer versions with plugins or patches, but your browser sniffing would assume that the functionality is not there based on version. It is better to do feature detection (e.g. with Modernizr http://modernizr.com/docs/ http://modernizr.com/docs/).