Jump to content

PHP get_browser() function


Axcelcius

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/90764-php-get_browser-function/
Share on other sites

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] => 
)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.