PHP get_browser() Function


Look up the browscap.ini file and return the capabilities of the browser:

$browser = get_browser();
Try it Yourself »

Definition and Usage

The get_browser() function looks up the user's browscap.ini file and returns the capabilities of the user's browser.



Parameter Values

Parameter Description
user_agent Optional. Specifies the name of an HTTP user agent. Default is the value of $HTTP_USER_AGENT. You can bypass this parameter with NULL
return_array Optional. If this parameter is set to TRUE, the function will return an array instead of an object

Technical Details

Return Value: Returns an object or an array with information about the user's browser on success, or FALSE on failure
PHP Version: 4+
Changelog: The return_array parameter was added in PHP 4.3.2