This function is an alias for apache_request_headers(). Please read the apache_request_headers() documentation for more information on how this function works.

 

so if you want to use this function in any platform,you should detect if it is exists:

if (!function_exists('getallheaders'))
{
    function getallheaders()
    {
        $headers = '';
        foreach ($_SERVER as $name => $value)
        {
            if (substr($name, 0, 5) == 'HTTP_')
            {
                $headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
            }
        }
        return $headers;
    }
}

  

相关文章:

  • 2021-11-15
  • 2021-10-04
  • 2017-12-09
  • 2021-06-11
  • 2022-02-16
  • 2021-10-15
  • 2021-11-16
猜你喜欢
  • 2022-02-17
  • 2021-11-27
  • 2022-02-22
  • 2021-11-17
  • 2021-11-23
相关资源
相似解决方案