Call to undefined function apache_request_headers()

前端 未结 6 971
广开言路
广开言路 2020-11-27 04:58

I\'ve just switched my scripts to a different server. On the previous server this worked flawlessly, and now that I\'ve switched them to a different server, I can\'t underst

6条回答
  •  暖寄归人
    2020-11-27 05:47

    same thing happened to me when using "apache_request_headers()" so i used this code - works perfectly for me to output all the headers:

     $value) {
            if(strpos($key, 'HTTP_') === 0) {
                $headers = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
                echo $headers." : ". $i[$headers] = $value . "
    "; } } ?>

    output example:

    Accept : text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Encoding : gzip, deflate
    Accept-Language : en-US,en;q=0.5
    Cache-Control : max-age=0
    Connection : keep-alive
    Host : example.com
    Referer : https://example.com/
    User-Agent : Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
    

提交回复
热议问题