php $http_response_header code,PHP $ http_response_header

介绍

超全局$http_response_header数组由HTTP响应标头填充,与get_headers()函数一样。该数组是在PHP的本地空间中创建的

$http_response_header

示例<?php

file_get_contents("http://localhost");

$arr=$http_response_header;

foreach ($arr as $key=>$val)

echo "

$key=>$val 

";

?>

输出结果

浏览器将显示类似于以下内容的结果0=>HTTP/1.1 302 Found

1=>Date: Tue, 08 Sep 2020 14:49:24 GMT

2=>Server: Apache/2.4.41 (Win64) OpenSSL/1.0.2s PHP/7.1.32

3=>X-Powered-By: PHP/7.1.32

4=>Location: http://localhost/dashboard/

5=>Content-Length: 0

6=>Connection: close

7=>Content-Type: text/html; charset=UTF-8

8=>HTTP/1.1 200 OK

9=>Date: Tue, 08 Sep 2020 14:49:24 GMT

10=>Server: Apache/2.4.41 (Win64) OpenSSL/1.0.2s PHP/7.1.32

11=>Last-Modified: Mon, 02 Sep 2019 15:45:31 GMT

12=>ETag: "1d99-59193dc9c3cc0"

13=>Accept-Ranges: bytes

14=>Content-Length: 7577

15=>Connection: close

16=>Content-Type: text/html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值