NYCPHP Meetup

NYPHP.org

[nycphp-talk] Browser detection

Federico Ulfo rainelemental at gmail.com
Wed May 1 15:51:32 EDT 2013


Hi all, how do you solve the problem of the browser detection?

The PHP built in function get_browser() doesn't seams to work very well,
it's slow and inaccurate, it also need a huge browscap.ini file to be
loaded and updated, and looks like isn't maintained really well.

The most accurate library I've found uses the user-agent-string.info API,
which isn't very fast, and it doesn't tell the device type, such as iPhone,
iPad, Android, etc.

Not satisfacted by the available solutions I've decided to create a library
that with dependency injection loads other parser, so it's flexible and
accurate. The library, Sail\Useragent, is open source and available on
packagist:
https://github.com/rainphp/useragent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20130501/efaf3fe3/attachment.html>


More information about the talk mailing list