May 2003
Intermediate to advanced
592 pages
14h 28m
English
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 ...
Read now
Unlock full access