How should I read any header in PHP?
For example the custom header: X-Requested-With
.
$_SERVER['HTTP_X_REQUESTED_WITH']
RFC3875, 4.1.18:
Meta-variables with names beginning with
HTTP_
contain values read from the client request header fields, if the protocol used is HTTP. The HTTP header field name is converted to upper case, has all occurrences of-
replaced with_
and hasHTTP_
prepended to give the meta-variable name.