Is there an way to get and turn the HTTP request headers into an associative array, using php? For example, let's say someone makes an HTTP request to somepage.php. The HTTP request looks like so:
Code: Select all
POST somepage.php HTTP/1.1
Host: url.com
From: somewhere.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 12345
body and stuffCode: Select all
if ($headers['From'] == "somewhere.net" && $headers['From'] != "somewhere.com") { }