Where's the best place to place PHP code that detects what Web browser I am using for a current session?

Re: Where's the best place to place PHP code that detects what Web browser I am using for a current session?

by Frankie Kam -
Number of replies: 0
Picture of Plugin developers
Thanks Tim. Your tip gave me this one line of code 

   core_useragent::is_firefox()
that is worth 5 lines of my earlier code.


$browser = $_SERVER['HTTP_USER_AGENT'];
$chrome = '/Chrome/';
$firefox = '/Firefox/';
$ie = '/MSIE/';
if (preg_match($firefox, $browser))

if (core_useragent::is_firefox()) 
{
    ...
}

You're the best!