Hi. This is a small code to check the browser is Internet explorer or not using the PHP.
<?php
if(preg_match('/(?i)msie [1-8]/', $_SERVER['HTTP_USER_AGENT']))
{
// The browser is IE
// write your code here
}
else
{
// The browser is other than IE
// write your code here
}
?>
If you are executing the above code in Internet explorer browser then if condition will execute. and if you are executing the code in other than Internet explorer then else condition will be executed.
Thank you
No comments:
Post a Comment