array apache_request_headers(void)
$_SERVER['HTTP_IF_MODIFIED_SINCE']
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 ""
;
print_r($head_arr);
print_r($head_arr_index);
echo "
";
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=/
)
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
)