php8.5
Home/ Manual/ apache / functions/ apache_response_headers

apache_response_headers

PHP function Edit on GitHub ✎

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

Fetch all HTTP response headers

Description

apache_response_headers(): array

Fetch all HTTP response headers. Works in the Apache, LiteSpeed, FastCGI, CLI, and FPM webservers.

Parameters Parameters

Return Values

An array of all Apache response headers on success.

Examples

apache_response_headers() example

php
<?php
print_r(apache_response_headers());
?>

The above example will output something similar to:

output
Array
(
    [Accept-Ranges] => bytes
    [X-Powered-By] => PHP/4.3.8
)

See Also

Source: reference/apache/functions/apache-response-headers.xml · from the official PHP manual (php/doc-en)