I need to retrieve the browser and OS through php coding.
I had used $_SERVER['HTTP_USER_AGENT'], but its shows the following
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 1.1.4322; IEMB3)
How can I separate the browser and OS from the above received value?
Please guide me..
Thanks in advance.
You could use the Google code Browscap class. It essentially does the same thing as PHP's get_browser(), but you don't have to worry about keeping your browscap.ini up to date.
This worked for me:
require('Browscap.php');
$browscap = new Browscap('/path/to/cache');
var_dump($browscap->getBrowser());
Just use the built in function for this http://ie.php.net/manual/en/function.get-browser.php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With