Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP get_browser() Function

PHP get_browser() Function

PHP Misc Reference Manual PHP Misc Reference Manual

Example

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

Run Example »


Definition and Usage

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


Syntax

get_browser(

user_agent,return_array

)

Parameters Description
user_agent Optional. Specifies the name of the HTTP user agent. Default is the value of $HTTP_USER_AGENT. You can bypass this parameter by setting it to NULL.
return_array Optional. If set to TRUE, this function returns an array instead of an object.

Technical Details

Return Value: On success, this function returns an object or an array containing information about the user's browser. On failure, it returns FALSE.
PHP Version: 4+
Changelog: In PHP 4.3.2, the return_array parameter was added.

PHP Misc Reference Manual PHP Misc Reference Manual