apache_request_headers()
A fallback for get request headers. Based on comments from http://php.net/manual/en/function.apache-request-headers.php
No Hooks.
Return
Array
. List of request headers
Usage
apache_request_headers();
apache_request_headers() apache request headers code WPSCache 1.12.4
function apache_request_headers() { $headers = array(); foreach ( array_keys( $_SERVER ) as $skey ) { if ( str_starts_with( $skey, 'HTTP_' ) ) { $header = implode( '-', array_map( 'ucfirst', array_slice( explode( '_', strtolower( $skey ) ), 1 ) ) ); $headers[ $header ] = $_SERVER[ $skey ]; } } return $headers; }