Web Browser Detection
Considering the number of different Web browsers available, along with the different settings users can adjust, ensuring a consistent Web experience for all visitors can be difficult. JavaScript—a client-side technology—can detect the Web browser type, version, and such with relative ease. One option for determining this information in a PHP script is the get_browser() function:
$browser = get_browser();
By default, this function will use the $HTTP_USER_AGENT (or $_SERVER['HTTP_USER_AGENT']) variable. The function then compares this value against the browscap.ini file, which is a text document listing browser specifications by version and platform. This file is available as a free download and must be installed on your ...
Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.