![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|||||||||||
get_browserDescriptionmixed get_browser ( [string user_agent [, bool return_array]] )get_browser() attempts to determine the capabilities of the user's browser. This is done by looking up the browser's information in the browscap.ini file. By default, the value of $_SERVER['HTTP_USER_AGENT'] is used; however, you can alter this (i.e., look up another browser's info) by passing the optional user_agent parameter to get_browser(). You can bypass user_agent parameter with NULL value. The information is returned in an object, which will contain various data elements representing, for instance, the browser's major and minor version numbers and ID string; TRUE/FALSE values for features such as frames, JavaScript, and cookies; and so forth. As of PHP 4.3.2, if the optional parameter return_array is TRUE, this function will return an array instead of an object.
The cookies value simply means that the browser itself is capable of accepting cookies and does not mean the user has enabled the browser to accept cookies or not. The only way to test if cookies are accepted is to set one with setcookie(), reload, and check for the value.
Copyright © 1997 - 2007 by the PHP Documentation Group. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later. A copy of the Open Publication License is distributed with this manual, the latest version is presently available at http://www.opencontent.org/openpub/. Please see full copyright text at http://www.php.net/manual/en/copyright.php Original version of the above documentation is available at http://www.php.net/manual/en/ |
|