Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

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.
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
•••
Appraise.net

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back