Consult the user's browscap.ini file and return the performance of the user's browser:
<?phpecho $_SERVER['HTTP_USER_AGENT'];$browser = get_browser();print_r($browser);?>The get_browser() function consults the user's browscap.ini file and returns the capabilities of the user's browser.
get_browser( user_agent,return_array )
parameter | describe |
---|---|
user_agent | Optional. Specifies the name of the HTTP user agent. The default is the value of $HTTP_USER_AGENT. You can bypass this parameter by setting NULL. |
return_array | Optional. If this parameter is set to TRUE, this function will return an array instead of an object. |
Return value: | If successful, the function returns an object or array containing the user's browser information. If it fails, returns FALSE. |
---|---|
PHP version: | 4+ |
Update log: | In PHP 4.3.2, the return_array parameter was added. |