I use below code to find user agent,
$user_agent = $_SERVER[\'HTTP_USER_AGENT\']; if (preg_match(\'/MSIE/i\', $user_agent)) { echo \"Internet
Try this :
$browser = get_browser(null, true); print_r($browser);
From doc : Attempts to determine the capabilities of the user's browser, by looking up the browser's information in the browscap.ini file.
ref: http://php.net/manual/en/function.get-browser.php