Reputation: 16823
When using the get_browser function in PHP on:
I have just downloaded the latest browscap.in file.
My user_agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
WAMP:
Array
(
[browser_name_regex] => §^.*$§
[browser_name_pattern] => *
[browser] => Default Browser
[version] => 0
[majorver] => 0
[minorver] => 0
[platform] => unknown
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] =>
[iframes] =>
[tables] =>
[cookies] =>
[backgroundsounds] =>
[javascript] =>
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[isbanned] =>
[ismobiledevice] =>
[issyndicationreader] =>
[crawler] =>
[cssversion] => 0
[aolversion] => 0
)
Server:
Array
(
[browser_name_regex] => �^mozilla/5\.0 \(.*windows nt 6\.1.*wow64.*rv:.*\) gecko/.* firefox/9\..*$�
[browser_name_pattern] => Mozilla/5.0 (*Windows NT 6.1*WOW64*rv:*) Gecko/* Firefox/9.*
[parent] => Firefox 9.0
[platform] => Win7
[win32] =>
[win64] => 1
[browser] => Firefox
[version] => 9.0
[majorver] => 9
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[javascript] => 1
[javaapplets] => 1
[cssversion] => 3
[minorver] => 0
[alpha] =>
[beta] =>
[win16] =>
[backgroundsounds] =>
[vbscript] =>
[activexcontrols] =>
[isbanned] =>
[ismobiledevice] =>
[issyndicationreader] =>
[crawler] =>
[aolversion] => 0
)
QUESTION: How do I fix this issue in WAMP so that it behaviours like the linux server?
Upvotes: 1
Views: 423
Reputation: 1391
I suggest to use this "Standalone replacement for php's native get_browser() function" https://github.com/garetjax/phpbrowscap
This library is suggested to be used in the Browsercap page
Here is a list of the features:
Upvotes: 1
Reputation: 27755
Seems that your php.ini
file didn't contain path to browscap
ini file.
Look if there present this setting:
[browscap]
browscap = /path/to/your/php_browscap.ini
Upvotes: 1