note 69821 deleted from tutorial.whatsnext by colder
| From: | colder@php.net | Date: | Fri, 22 Sep 2006 10:51:52 +0000 |
| Subject: | note 69821 deleted from tutorial.whatsnext by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117414@lists.php.net to get a copy of this message | ||
Note Submitter: jojo4jeyjey at yahoo dot com
Reason: useless
----
Let us do something more useful now. We are going to check what sort of browser the visitor is
using. For that, we check the user agent string the browser sends as part of the HTTP request. This
information is stored in a variable. Variables always start with a dollar-sign in PHP. The variable
we are interested in right now is $_SERVER['HTTP_USER_AGENT'].
Note: $_SERVER is a special reserved PHP variable that contains all web server information. It
is known as an autoglobal (or superglobal). See the related manual page on superglobals for more
information. These special variables were introduced in PHP 4.1.0. Before this time, we used the
older $HTTP_*_VARS arrays instead, such as $HTTP_SERVER_VARS. Although deprecated, these older
variables still exist. (See also the note on old code.)
To display this variable, you can simply do: