Skip to content

Instantly share code, notes, and snippets.

@geraintp
geraintp / apache_request_headers.php
Last active October 30, 2018 12:03 — forked from ivanrosolen/apache_request_headers.php
apache_request_headers
<?php
if( !function_exists('apache_request_headers') ) {
function apache_request_headers() {
$arh = array();
$rx_http = '/\AHTTP_/';
foreach($_SERVER as $key => $val) {
if( preg_match($rx_http, $key) ) {
$arh_key = preg_replace($rx_http, '', $key);
$rx_matches = array();
// do some nasty string manipulations to restore the original letter case