I’m using the below code to check if visitor is using Chrome Browser:
<?php
function is_chrome()
{
return(eregi("chrome", $_SERVER['HTTP_USER_AGENT']));
}
if(is_chrome())
{
echo 'You are using Google Chrome Browser.';
}
?>
also
<?php
function is_firefox()
{
return(eregi("firefox", $_SERVER['HTTP_USER_AGENT']));
}
if(is_chrome())
{
echo 'You are using Firefox Browser.';
}
?>
is working fine, but how can i combine or how to use “or” function, so to check if httpuseragent contains “chrome” or “firefox”?
Thanks
http://php.net/manual/en/language.operators.logical.php
That page also includes examples.