Browscap

PHP includes a function named get_browser() which attempts to determine the capabilities of a website visitor's browser by looking up the browser's information from a file named browscap.ini.

The browscap.ini file is not bundled with PHP, instead it is made available through the Browser Capabilities Project, an organization which generously keeps the browser information accurate and up-to-date. Although the Browser Capabilities Project provides updated versions of browscap.ini free of charge, properly managing browscap.ini is tedious, repetitive and, in some cases, is not even possible as it required modifying php.ini (which may be restricted in certain shared hosting environments).

The Browscap module provides the browscap_get_browser() function which operates identically to get_browser() but relies on an internal database of browser information instead of the browscap.ini file. Browscap's internal database is automatically populated and kept up-to-date using the same Browser Capabilities Project information that is used by browscap.ini. By using an internal database, Browscap also bypasses the requirement to have access to php.ini.

A number of popular modules and themes integrate with Browscap:

Browscap is currently available for Drupal 6 + 7 and has been deployed on 10000+ websites around the world.

Category: