get_browser function is not working properly for me..
I have requirement to get full info of Browser ..Here is my code and output i am getting.
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$browser = get_browser($user_agent, true);
echo "<pre>";print_r($browser);echo "</pr开发者_开发知识库e>";
OUTPUT WHAT I AM GETTING AND WHICH IS NOT DESIRED IS
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] =>
)
can anyone tell me where i am lacking to get desired output
From the PHP docs:
Note:
In order for this to work, your browscap configuration setting in php.ini must point to the correct location of the browscap.ini file on your system.
browscap.ini is not bundled with PHP, but you may find an up-to-date php_browscap.ini file here.
While browscap.ini contains information on many browsers, it relies on user updates to keep the database current. The format of the file is fairly self-explanatory.
You will get this result if you have either not configured this, or if your configuration does not include the browser you're using. It's been years since I used this, but if I recall correctly you just need to download the file and include it in the same directory as your PHP file for this to work.
精彩评论