HTTP Request Headers in PHP
In PHP, you can get the values
of request headers. They are contained
in the $_SERVER superglobal
array. The key for each request header
starts with 'HTTP_', followed
by the name of that header in uppercase
letters.
Let's, for example, get the contents
of the Host header:
<?php
echo $_SERVER['HTTP_HOST'];
?>
If the header name contains hyphens,
they are converted to underscores in the key
in PHP. As an example,
let's get the contents of the header
Accept-Encoding:
<?php
echo $_SERVER['HTTP_ACCEPT_ENCODING'];
?>
Get the value of the Accept header.
Get the value of the Accept-Language header.
Output the contents of the $_SERVER variable
using var_dump. Visually, "by eye", determine
which values are headers and which are
something else.