Ayusch
Ayusch

Reputation: 439

PHP get_browser() function Output error

I tried to use the get_browser() function in php and here is the code:

<?php
    $browser=get_browser(null,true);
    echo $browser['browser'];
?>

It just prints out default browser. Please help

I have alredy modified php.ini file to detect browscap.ini.

Upvotes: 1

Views: 260

Answers (1)

Birdy
Birdy

Reputation: 773

Not the best at php and still learning myself, However you could try this...

<?php
echo $_SERVER['HTTP_USER_AGENT'] . "\n\n";

$browser = get_browser(null, true);
print_r($browser);
?>

Or you could just have...

<?php
$browser = get_browser(null, true);
print_r($browser);
?>

Let me know how you get on.. Thanks.

Upvotes: 1

Related Questions