2 ms·
Most developers would find and use a library rather than write their own parser. They pretty reliably extract the browser/version/platform/etc from the hundreds
by dangrossman 12y ago
Most developers would find and use a library rather than write their own parser. They pretty reliably extract the browser/version/platform/etc from the hundreds of thousands of UA strings you'll see in the wild.
https://github.com/tobie/ua-parser https://github.com/tobie/ua-parser
https://github.com/browscap/browscap https://github.com/browscap/browscap
A user agent parser is built in to the PHP language as well.
http://php.net/manual/en/function.get-browser.php http://php.net/manual/en/function.get-browser.php