webmaster1 Posted March 22, 2010 Share Posted March 22, 2010 I want to echo a message if my document is being viewed in IE6. I've come across the following 2 ways: <!--[if IE 6]> <p>IE6 detected!</p> <![endif]--> or <?php if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.0') !== FALSE) { echo 'IE6 detected!'; } /* else { echo 'IE6 not detected!'; } */ ?> Which approach do you reccomend? Quote Link to comment https://forums.phpfreaks.com/topic/196108-php-browser-detection/ Share on other sites More sharing options...
scvinodkumar Posted March 22, 2010 Share Posted March 22, 2010 Both will work the same way, looking for user-agent, if you want to give alert box in the page, you can go with javascript or if you want to display information in stylish way then go with php way... Quote Link to comment https://forums.phpfreaks.com/topic/196108-php-browser-detection/#findComment-1029927 Share on other sites More sharing options...
webmaster1 Posted March 22, 2010 Author Share Posted March 22, 2010 Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/196108-php-browser-detection/#findComment-1029930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.