yakeing/get_header

This function is similar to the get_headers function

v1.0.1 2019-08-06 08:52 UTC

This package is auto-updated.

Last update: 2024-11-16 14:11:46 UTC


README

This function is similar to the get_headers function.

get_headers is recommended because it is more efficient.

Travis CI badge

Travis-ci

codecov badge

codecov

Github badge

Downloads Size tag license languages

Installation

Use Composer to install the library. Of course, You can go to Packagist to view.

    $ composer require yakeing/get_header

test

  • example
      include('GetHeader.php');
      $url = "https://github.com/yakeing/get_header";
      $GetHeader = new GetHeader();
      $Header = GetHeader->curlHeader($url);
      var_dump($Header);

outcome

  • example
    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)
    )

Sponsor

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.

Sponsor

Author

weibo: yakeing

twitter: yakeing