protected function getHeaders()
    {
        if (function_exists('getallheaders')) {
            return getallheaders();
        }
        $arr_headers = [];
        foreach ($_SERVER as $str_key => $str_value) {
            if (strpos($str_key, 'HTTP_') === 0) {
                $arr_headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($str_key, 5)))))] = $str_value;
            }
        }
        return $arr_headers;
    }
protected function getHeaders()
    {
        if (function_exists('getallheaders')) {
            return getallheaders();
        }
        $arr_headers = [];
        foreach ($_SERVER as $str_key => $str_value) {
            if (strpos($str_key, 'HTTP_') === 0) {
                $arr_headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($str_key, 5)))))] = $str_value;
            }
        }
        return $arr_headers;
    }
protected function getHeaders ( ) { if ( function_exists ( 'getallheaders' ) ) { return getallheaders ( ) ; } $ arr_headers = [ ] ; foreach ( $ _SERVER as $ str_key => $ str_value ) { if ( strpos ( $ str_key , 'HTTP_' ) === 0 ) { $ arr_headers [ str_replace ( ' ' , '-' , ucwords ( strtolower ( str_replace ( '_' , ' ' , substr ( $ str_key , 5 ) ) ) ) ) ] = $ str_value ; } } return $ arr_headers ; }
Get the HTTP request headers

getallheaders() available for CGI (in addition to Apache) from PHP 5.4

Fall back to manual processing of $_SERVER if needed

@todo Test on Google App Engine

@return array
Get the HTTP request headers