PHP获取HTTP头信息
来源:互联网 发布:mac os x install dvd 编辑:程序博客网 时间:2024/05/20 02:56
- 获取全部(客户端)HTTP请求头信息
#1 array apache_request_headers(void) #2:通过$_SERVER获取,每个http请求头信息都以"HTTP_"开头在$_SERVER键中 # 获取if_modified_since的请求信息 $_SERVER['HTTP_IF_MODIFIED_SINCE']
- 获取服务器响应一个HTTP请求所发送的所有标头
# url 请求的服务器的URL地址 # format 0:返回的头部信息以索引数字形式,1:返回头部信息以关联数组形式 array get_headers(string $url [, int $format = 0 ] ) #示例 $head_arr = get_headers("https://www.baidu.com"); $head_arr_index = get_headers("https://www.baidu.com",1); echo "<pre>"; print_r($head_arr); print_r($head_arr_index); echo "</pre>"; #输出结果分别为: #head_arr Array ( [0] => HTTP/1.1 200 OK [1] => Server: bfe/1.0.8.18 [2] => Date: Tue, 25 Apr 2017 02:50:57 GMT [3] => Content-Type: text/html [4] => Content-Length: 14720 [5] => Connection: close [6] => Last-Modified: Tue, 18 Apr 2017 01:09:00 GMT [7] => Vary: Accept-Encoding [8] => Set-Cookie: BAIDUID=B4D4AA198C8E598CF3980583DA807FA1:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [9] => Set-Cookie: BIDUPSID=B4D4AA198C8E598CF3980583DA807FA1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [10] => Set-Cookie: PSTM=1493088657; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [11] => P3P: CP=" OTI DSP COR IVA OUR IND COM " [12] => X-UA-Compatible: IE=Edge,chrome=1 [13] => Pragma: no-cache [14] => Cache-control: no-cache [15] => Accept-Ranges: bytes [16] => Set-Cookie: __bsi=12770957019260228058_00_10_N_N_15_0303_C02F_N_N_N_0; expires=Tue, 25-Apr-17 02:51:02 GMT; domain=www.baidu.com; path=/ ) #head_arr_index Array ( [0] => HTTP/1.1 200 OK [Server] => bfe/1.0.8.18 [Date] => Tue, 25 Apr 2017 02:47:11 GMT [Content-Type] => text/html [Content-Length] => 14720 [Connection] => close [Last-Modified] => Tue, 18 Apr 2017 01:09:00 GMT [Vary] => Accept-Encoding [Set-Cookie] => Array ( [0] => BAIDUID=D0D69F175CC2E4C205E8EA6D1DEAA1BB:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [1] => BIDUPSID=D0D69F175CC2E4C205E8EA6D1DEAA1BB; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [2] => PSTM=1493088431; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com [3] => __bsi=11987508469614704611_00_22_N_N_16_0303_C02F_N_N_N_0; expires=Tue, 25-Apr-17 02:47:16 GMT; domain=www.baidu.com; path=/ ) [P3P] => CP=" OTI DSP COR IVA OUR IND COM " [X-UA-Compatible] => IE=Edge,chrome=1 [Pragma] => no-cache [Cache-control] => no-cache [Accept-Ranges] => bytes )
0 0
- PHP获取http头信息
- PHP获取http头信息
- PHP获取HTTP头信息
- php如何获取http头信息
- 获取http 头信息
- 获取http响应头信息
- php设置http请求头信息和响应头信息
- 获取http头 的 referrer 信息
- java中获取http头信息
- Servlet--获取Http协议请求头信息
- php 获取远程网址header头信息
- php获取请求返回头信息
- 用php获取header头信息
- php获取客户端请求的http头
- 关于获取java获取http响应头信息
- servlet笔记(四)获取http请求头信息
- HTTP 自定义头信息的一个注意事项 下划线 for php
- PHP中使用header函数发送http头信息
- 数学工具笔记之一:一张图告诉你什么是时域和频域
- informix 分片表
- Android ScrollView 和ListView 一起使用的问题汇总
- 反射
- 万能的GridView,定制你想要的网格线
- PHP获取HTTP头信息
- 重新blas库函数
- 移动讲堂:如何避免App外包被坑?
- tomcat+Myeclipse详细web开发部署
- Linux下查看和添加PATH环境变量
- “APP故障门”频出,移动应用开发到底应该怎么做?
- Spark RDD基础
- informix 多实例安装
- Spring常用的四大注解