Fast, easy PHP/ IE8 question

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch
Impact
417
What is the correct code to "do something different" for people who use IE <9. All I need is the most dependable browser detection. Like this:

PHP:
<?php

if (ie < 9 "what goes here instead of 'ie < 9'") { 
place code here for older IE users ; }
?>

Thanks

EDIT:
Let's change the question to "what is your favorite method?"
Looks like there are "many false positives in parsing the $_SERVER["HTTP_USER_AGENT"] for IE6"
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
IE detection is indeed very useful in some cases as this browser is known for causing many related to the html standard problems and breaking our beautiful styles. :)

I do it that way:
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')!==false) $ie=1; else $ie=0;

As for detecting some particular IE version, you can use:
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.')!==false) $ie=6; else $ie=0;
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back