home ~ previous

PHP

Browser Detection

I don’t have a problem with IE 6, 7 or 8 - they were products of their time. Sure there were issues with them, but then there were issues with all the competing browsers as well. MS just got the bad press, but as functioning browsers, they were fine. Millions of people used them and enjoyed the Internet because of them.

I don’t have a problem with IE 6, 7 or 8...

Just the fuqtaads who still use them!

I spend a good portion of my life making sure that such and such a website looks fine in one of these old browsers, just because some trog can’t or won’t upgrade.

There are many methods out there to help find out what browser the user is using.

The beautiful people are all using HTML5 Cross Browser Polyfills and Modernizr, but sometimes you need a simple PHP fix to filter out an issue on a specific browser.

I use this:

1
2
3
4
5
<?php 
if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE 7.0')){
    echo 'This browser is IE7';
}
?>

home ~ previous

Rohan Leach .... thoughtful