HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

http_get_last_response_headers

Description

The http_get_last_response_headers of Network for PHP retrieves the last HTTP response headers.

Syntax

http_get_last_response_headers(): ?array

Return

Returns an indexed array of HTTP headers which were received while using the HTTP wrapper. If there are none, null is returned instead.

Examples

1 · void

<?

$filename = "https://osbo.com";

file_get_contents($filename);

$return = http_get_last_response_headers();

print_r($return);
Array
(
    [0] => HTTP/1.1 200 OK
    [1] => Connection: close
    [2] => Cache-Control: no-store,no-transform
    [3] => link: <https://osbo.com/>;rel="canonical"
    [4] => x-robots-tag: noarchive,noimageindex
    [5] => Content-Type: text/html; charset=UTF-8
    [6] => Date: Tue, 20 Jan 2026 19:14:42 GMT
    [7] => Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
    [8] => X-Content-Type-Options: nosniff
)