1. <legend id='qdWXz'><style id='qdWXz'><dir id='qdWXz'><q id='qdWXz'></q></dir></style></legend>
        <bdo id='qdWXz'></bdo><ul id='qdWXz'></ul>

    2. <i id='qdWXz'><tr id='qdWXz'><dt id='qdWXz'><q id='qdWXz'><span id='qdWXz'><b id='qdWXz'><form id='qdWXz'><ins id='qdWXz'></ins><ul id='qdWXz'></ul><sub id='qdWXz'></sub></form><legend id='qdWXz'></legend><bdo id='qdWXz'><pre id='qdWXz'><center id='qdWXz'></center></pre></bdo></b><th id='qdWXz'></th></span></q></dt></tr></i><div id='qdWXz'><tfoot id='qdWXz'></tfoot><dl id='qdWXz'><fieldset id='qdWXz'></fieldset></dl></div>
    3. <small id='qdWXz'></small><noframes id='qdWXz'>

      <tfoot id='qdWXz'></tfoot>

        如何获取响应标头?

        How can I get the response headers?(如何获取响应标头?)
          • <bdo id='KzcvY'></bdo><ul id='KzcvY'></ul>
              <legend id='KzcvY'><style id='KzcvY'><dir id='KzcvY'><q id='KzcvY'></q></dir></style></legend>
                <i id='KzcvY'><tr id='KzcvY'><dt id='KzcvY'><q id='KzcvY'><span id='KzcvY'><b id='KzcvY'><form id='KzcvY'><ins id='KzcvY'></ins><ul id='KzcvY'></ul><sub id='KzcvY'></sub></form><legend id='KzcvY'></legend><bdo id='KzcvY'><pre id='KzcvY'><center id='KzcvY'></center></pre></bdo></b><th id='KzcvY'></th></span></q></dt></tr></i><div id='KzcvY'><tfoot id='KzcvY'></tfoot><dl id='KzcvY'><fieldset id='KzcvY'></fieldset></dl></div>
                  <tbody id='KzcvY'></tbody>
              • <tfoot id='KzcvY'></tfoot>
              • <small id='KzcvY'></small><noframes id='KzcvY'>

                • 本文介绍了如何获取响应标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在 PHP CLI 中连接到远程主机并发送一些标头.然后我的脚本等待响应.我可以将其全部打印出来,但随后它会返回 HTML.我只想要标题.我该怎么做?

                  I'm currently connecting to a remote host in PHP CLI and sending some headers. My script then waits for the response. I can have it all print out, but then it returns the HTML. I only want the headers. How can I do this?

                  推荐答案

                  接收HTTP响应的格式与发送请求基本相同:headers和body用两个CRLF( ).

                  The format for receiving a HTTP response is basically the same as for sending a request: headers and body are separated with two CRLF ( ).

                  $parts = explode("
                  
                  ", $http_response);
                  $headers = array_shift($parts);
                  $body = implode("
                  
                  ", $parts);
                  

                  这篇关于如何获取响应标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  PHP Upload File Validation(PHP 上传文件验证)
                  PHP Error - Uploading a file(PHP 错误 - 上传文件)
                  How can I write tests for file upload in PHP?(如何在 PHP 中编写文件上传测试?)
                  php resizing image on upload rotates the image when i don#39;t want it to(php在上传时调整图像大小会在我不想要它时旋转图像)
                  How to send additional data using PLupload?(如何使用 PLupload 发送附加数据?)
                  change button text in js/ajax after mp4 =gt;mp3 conversion in php(在 php 中的 mp4 =gt;mp3 转换后更改 js/ajax 中的按钮文本)
                  • <bdo id='bw4w7'></bdo><ul id='bw4w7'></ul>
                      <tfoot id='bw4w7'></tfoot>

                    1. <i id='bw4w7'><tr id='bw4w7'><dt id='bw4w7'><q id='bw4w7'><span id='bw4w7'><b id='bw4w7'><form id='bw4w7'><ins id='bw4w7'></ins><ul id='bw4w7'></ul><sub id='bw4w7'></sub></form><legend id='bw4w7'></legend><bdo id='bw4w7'><pre id='bw4w7'><center id='bw4w7'></center></pre></bdo></b><th id='bw4w7'></th></span></q></dt></tr></i><div id='bw4w7'><tfoot id='bw4w7'></tfoot><dl id='bw4w7'><fieldset id='bw4w7'></fieldset></dl></div>
                        <tbody id='bw4w7'></tbody>

                          • <small id='bw4w7'></small><noframes id='bw4w7'>

                            <legend id='bw4w7'><style id='bw4w7'><dir id='bw4w7'><q id='bw4w7'></q></dir></style></legend>