search

Home  >  Q&A  >  body text

How to get HTTPS response headers in PHP?

Like the title

ゅ﹎*手座゛ゅ﹎*手座゛2633 days ago898

reply all(1)I'll reply

  • 按键盘手指磨破皮

    按键盘手指磨破皮2017-09-17 20:53:11

    Use the apache_request_headers function to obtain, such as

    $headers = apache_request_headers();
    
    foreach ($headers as $header => $value) {
        echo "$header: $value <br />\n";
    }
    获取到的信息就是
    Accept: */*
    Accept-Language: en-us
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0
    Host: www.example.com
    Connection: Keep-Alive


    reply
    0
  • Cancelreply