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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.