Fast, easy PHP/ IE8 question

SpaceshipSpaceship
SpaceshipSpaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
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
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back