Answer the question
In order to leave comments, you need to log in
How to implement browser detection script?
Interested in the same functionality as on 2ip.ru , where the exact version of the browser is determined.
Answer the question
In order to leave comments, you need to log in
I am using this function:
function get_user_browser() {
preg_match("/(Opera|Firefox|Chrome|Chromium|Safari|MSIE)[\s\/]?([0-9]+)/", $_SERVER['HTTP_USER_AGENT'], $browser_info);
$browser = array();
$browser['name'] = !empty($browser_info[1]) ? $browser_info[1] : null;
$browser['version'] = !empty($browser_info[2]) ? $browser_info[2] : null;
return $browser;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question