getallheaders

array getallheaders() 

Gets the HTTP headers that the client sent.

Returns:

Associative array containing a list of HTTP headers, or FALSE on error

Description:

Call this function to retrieve an array of all HTTP headers sent by the client browser to the server. This function returns an associative array filled with the headers, in which each key is the name of the header, and each data element is the value associated with that name. If you have safe_mode enabled in PHP, the "authorization" header isn’t included in the result set.

Header names are not case-sensitive. A client may send "User-Agent: foo" or "user-agent: foo", or use any other combination of upper- and lowercase for the header name. However, the name of the key in ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.