Axcelcius Posted February 12, 2008 Share Posted February 12, 2008 When I print out a normal get_browser() this is my result: Array ( [browser_name_regex] => ^.*$ [browser_name_pattern] => * [browser] => Default Browser [css] => 0 [frames] => [iframes] => [tables] => 1 [cookies] => [backgroundsounds] => [vbscript] => [javascript] => [javaapplets] => [activexcontrols] => [cdf] => [aol] => [beta] => [win16] => [crawler] => [stripper] => [wap] => [netclr] => ) How can I fix it so that the browser information is present? Quote Link to comment https://forums.phpfreaks.com/topic/90764-php-get_browser-function/ Share on other sites More sharing options...
Axcelcius Posted February 12, 2008 Author Share Posted February 12, 2008 I missed some information. Here is the code: echo $_SERVER['HTTP_USER_AGENT']; $browser = get_browser($_SERVER['HTTP_USER_AGENT'], true); echo "<pre>"; print_r($browser); echo "</pre>"; And here is the result: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12 Array ( [browser_name_regex] => ^.*$ [browser_name_pattern] => * [browser] => Default Browser [css] => 0 [frames] => [iframes] => [tables] => 1 [cookies] => [backgroundsounds] => [vbscript] => [javascript] => [javaapplets] => [activexcontrols] => [cdf] => [aol] => [beta] => [win16] => [crawler] => [stripper] => [wap] => [netclr] => ) Quote Link to comment https://forums.phpfreaks.com/topic/90764-php-get_browser-function/#findComment-465278 Share on other sites More sharing options...
Axcelcius Posted February 12, 2008 Author Share Posted February 12, 2008 I couldn't figure out the problem completely so I just implemented this: http://garetjax.info/projects/browscap and it worked. Quote Link to comment https://forums.phpfreaks.com/topic/90764-php-get_browser-function/#findComment-465320 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.