$_SERVER['HTTP_USER_AGENT']

The $_SERVER['HTTP_USER_AGENT'] variable tells you which browser type a visitor is using to view your page. This is particularly useful if your code is browser specific.

Use as follows:

echo $_SERVER['HTTP_USER_AGENT'];

Using the $_SERVER['HTTP_USER_AGENT'] on this page will output the following:

CCBot/1.0 (+http://www.commoncrawl.org/bot.html)

See also:

$_SERVER['HTTP_REFERER']
$_SERVER['REMOTE_ADDR']
$_SERVER['PHP_SELF']
$_SERVER['REQUEST_URI']
$_SERVER['DOCUMENT_ROOT']
$_SERVER['HTTP_HOST']
$_SERVER['QUERY_STRING']
$_SERVER['SCRIPT_FILENAME']