Link to home
Start Free TrialLog in
Avatar of peps03
peps03

asked on

Detect Goolge Chrome browser not working

Hi,

I'm tring to detect the google chrome browser like this:

<?    if (strpos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== FALSE)
        echo "you're chrome..";
    else
        echo "not using google chrome.....!";?>

But it doesn't work..

This does work:
<?    if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)
        echo "you're ie..";
    else
        echo "no ie!";?>

What am i doing wrong? I would says its in the name "chrome" because the code is the same..

Thanks
Avatar of kostantinos1995
kostantinos1995

Check this out:

if ( eregi("chrome", $_SERVER['HTTP_USER_AGENT']) ) {
// Google chrome
} else {
// Not Google chrome
}
ASKER CERTIFIED SOLUTION
Avatar of Phil Phillips
Phil Phillips
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peps03

ASKER

Thanks Decorum!!

Its finally working the way i want it to!