Link to home
Start Free TrialLog in
Avatar of lvmllc
lvmllcFlag for United States of America

asked on

browscaps get OS version

I can get the browser info as follows

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true

but, when I use the browscap.ini I only get that it is XYZ browser on a Mac OS X.  I want to know what version of the OS is installed.
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

When you write, I can get the browser info as follows how do you get this information?

Please use var_dump() to print the output from the browscap instructions and post it here, thanks.
Avatar of lvmllc

ASKER

two examples - the first is capable of identifying the version of Mac OS X while the get_browser() does not.


echo $_SERVER['HTTP_USER_AGENT'];
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

$browser = get_browser(null,true);
var_dump($browser);

array(28) { ["browser_name_regex"]=> string(53) "^mozilla/5\.0 (.*mac os x.*) gecko/.* firefox/10\..*$" ["browser_name_pattern"]=> string(45) "Mozilla/5.0 (*Mac OS X*) Gecko/* Firefox/10.*" ["parent"]=> string(12) "Firefox 10.0" ["platform"]=> string(6) "MacOSX" ["win32"]=> string(0) "" ["browser"]=> string(7) "Firefox" ["version"]=> string(4) "10.0" ["majorver"]=> string(2) "10" ["frames"]=> string(1) "1" ["iframes"]=> string(1) "1" ["tables"]=> string(1) "1" ["cookies"]=> string(1) "1" ["javascript"]=> string(1) "1" ["javaapplets"]=> string(1) "1" ["cssversion"]=> string(1) "3" ["minorver"]=> string(1) "0" ["alpha"]=> string(0) "" ["beta"]=> string(0) "" ["win16"]=> string(0) "" ["win64"]=> string(0) "" ["backgroundsounds"]=> string(0) "" ["vbscript"]=> string(0) "" ["activexcontrols"]=> string(0) "" ["isbanned"]=> string(0) "" ["ismobiledevice"]=> string(0) "" ["issyndicationreader"]=> string(0) "" ["crawler"]=> string(0) "" ["aolversion"]=> string(1) "0" }
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial