<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']);
if(ereg("msie 8", $br)) {echo 'Module for Internet Explorer 8';}
else {echo 'Module for the rest of browsers";}
?>
It works perfectly, but I am not a php expert and perhaps it is not the best solution among all of the mentioned in Stackoverflow.
Adding onto the above post…if this is to coverup something that you feel isn’t doable in IE8 and below (or whatever it is) please let us know. We have experts in this forum who can tell you if you actually need this functionality
Well why do you need a module for IE8? What makes that browser so special as to get the module but others don’t? Is this an alternate module since you find IE8 doesn’t support something?
Yes, that is exactly the issue. The module works normally but in IE8, so I have included the script to add a variation (without jQuery) to have it working properly in this browser.
And it works. The problem is whether this is the best way to do it.
<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']);
if(ereg("msie 8", $br)) {echo 'Module for Internet Explorer 8';}
else {echo 'Module for the rest of browsers";}
?>
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.
If Pocsan’s script is not recommended, what script should I use?
What about my original proposal?
<?php
$br = strtolower($_SERVER['HTTP_USER_AGENT']);
if(ereg("msie 8", $br)) {echo 'Module for Internet Explorer 8';}
else {echo 'Module for the rest of browsers";}
?>