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

        <legend id='o9ale'><style id='o9ale'><dir id='o9ale'><q id='o9ale'></q></dir></style></legend>
      1. 在 php 中获取请求的 url 的 Content-Type

        Get Content-Type of requested url in php(在 php 中获取请求的 url 的 Content-Type)
        <legend id='2O1s7'><style id='2O1s7'><dir id='2O1s7'><q id='2O1s7'></q></dir></style></legend>

        <small id='2O1s7'></small><noframes id='2O1s7'>

            <tbody id='2O1s7'></tbody>

          1. <i id='2O1s7'><tr id='2O1s7'><dt id='2O1s7'><q id='2O1s7'><span id='2O1s7'><b id='2O1s7'><form id='2O1s7'><ins id='2O1s7'></ins><ul id='2O1s7'></ul><sub id='2O1s7'></sub></form><legend id='2O1s7'></legend><bdo id='2O1s7'><pre id='2O1s7'><center id='2O1s7'></center></pre></bdo></b><th id='2O1s7'></th></span></q></dt></tr></i><div id='2O1s7'><tfoot id='2O1s7'></tfoot><dl id='2O1s7'><fieldset id='2O1s7'></fieldset></dl></div>
              <bdo id='2O1s7'></bdo><ul id='2O1s7'></ul>
              <tfoot id='2O1s7'></tfoot>
                1. 本文介绍了在 php 中获取请求的 url 的 Content-Type的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  使用 php 如何将变量 $type 定义为 content-type" rel="nofollow">http://www.example.com

                  Using php how would I be able to define the variable $type into the content-type of http://www.example.com

                  例如:$type定义为"text/html"

                  到目前为止,这是我正在使用的:

                  So far this is what i am working with:

                  <?php
                  $url = 'http://www.example.com';
                  print_r(get_headers($url));
                  print_r(get_headers($url, 1));
                  ?>
                  

                  可以根据需要更改代码

                  推荐答案

                  你试过了吗:

                  $type = get_headers($url, 1)["Content-Type"];
                  

                  正如@Michael 在评论中指出的那样,如果没有最新版本的 PHP,这种语法将无法工作.

                  As noted in comments by @Michael, this syntax won't work without a very current version of PHP.

                  你也试过了吗:

                  $headers = get_headers($url, 1);
                  $type = $headers["Content-Type"];
                  

                  ?

                  这篇关于在 php 中获取请求的 url 的 Content-Type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <i id='std2I'><tr id='std2I'><dt id='std2I'><q id='std2I'><span id='std2I'><b id='std2I'><form id='std2I'><ins id='std2I'></ins><ul id='std2I'></ul><sub id='std2I'></sub></form><legend id='std2I'></legend><bdo id='std2I'><pre id='std2I'><center id='std2I'></center></pre></bdo></b><th id='std2I'></th></span></q></dt></tr></i><div id='std2I'><tfoot id='std2I'></tfoot><dl id='std2I'><fieldset id='std2I'></fieldset></dl></div>
                  • <bdo id='std2I'></bdo><ul id='std2I'></ul>
                  • <tfoot id='std2I'></tfoot>

                        • <legend id='std2I'><style id='std2I'><dir id='std2I'><q id='std2I'></q></dir></style></legend>
                            <tbody id='std2I'></tbody>

                            <small id='std2I'></small><noframes id='std2I'>