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-cache,no-store,no-transform
    [3] => x-robots-tag: noarchive,noimageindex
    [4] => content-type: text/html; charset=UTF-8
    [5] => date: Mon, 20 Jan 2025 03:03:11 GMT
    [6] => strict-transport-security: max-age=31536000; includeSubDomains; preload
    [7] => x-content-type-options: nosniff
)