This function is similar to the get_headers function., (*1)
get_headers
is recommended because it is more efficient., (*2)
Travis CI badge
, (*3)
codecov badge
, (*4)
Github badge
, (*5)
Installation
Use Composer to install the library.
Of course, You can go to Packagist to view., (*6)
$ composer require yakeing/get_header
test
include('GetHeader.php');
$url = "https://github.com/yakeing/get_header";
$GetHeader = new GetHeader();
$Header = GetHeader->curlHeader($url);
var_dump($Header);
outcome
Array
(
[code] = 606
[Server] = nginx/1.4.1
[Date] = Tue, 15 Sep 2015 20:17:27 GMT
[Content-Type] = text/html
[Content-Length] = 464
[Connection] = close
[ETag] = "55b07eb9-1d0"
)
Array
(
[code] = 200
[Server] = nginx/1.4.1
[Date] = Tue, 15 Sep 2015 20:17:28 GMT
[Content-Type] = text/html; charset=utf-8
[Connection] = close
[Set-Cookie] = expires=Wed, 16-Sep-2015 20:17:28 GMT; path=/; domain=.sinacloud.com
[Expires] = Thu, 19 Nov 1981 08:52:00 GMT
[Cache-Control] = private
[Pragma] = no-cache
[Via] = 10.67.15.158
[Vary] = Accept-Encoding
)
Array
(
[code] = 200
[Server] = nginx/1.4.1
[Date] = Tue, 15 Sep 2015 20:17:28 GMT
[Content-Type] = image/jpeg
[Content-Length] = 40836
[Connection] = close
[Accept-Ranges] = bytes
[Access-Control-Allow-Origin] = *
[Access-Control-Max-Age] = 2592000
[Cache-Control] = public, max-age=31536000
[Content-Disposition] = inline; filename="weixin.jpg"
[Content-Transfer-Encoding] = binary
[ETag] = "FnDvgIWd1W48UL3WzKYwB7UfrS9w"
[Last-Modified] = Thu, 20 Aug 2015 04:01:43 GMT
[X-Log] = mc.g;IO:2
[X-Reqid] = FGAAAMR9NAAXQAQU
[X-Qiniu-Zone] = 0
[X-Via] = 1.1 ych69:80 (Cdn Cache Server V2.0), 1.1 xdx20:5 (Cdn Cache Server V2.0)
)
If you've got value from any of the content which I have created, then I would very much appreciate your support by payment donate., (*7)
, (*8)
Author
weibo: yakeing, (*9)
twitter: yakeing, (*10)