PHP headers_list() Function
Definition and Usage
The headers_list() function returns a list of sent (or pending to be sent) response headers.
This function returns an array containing headers.
Syntax
headers_list()
Tips and Comments
Tip:To determine if headers have been sent, use the headers_sent() function.
Example
<?php setcookie("TestCookie","SomeValue"); header("X-Sample-Test: foo"); header('Content-type: text/plain'); ?> <html> <body> <?php // Send which headers? var_dump(headers_list()); ?> </body> </html>