Retreive headers to be sent in PHP
The headers_list function tells us whether or not HTTP headers have already been sent to the client and also returns headers that have yet to be sent. The function takes no parameters, and returns an array. The returned array contains a numerically indexed list of the headers that are ready to be sent.
Syntax:
array headers_list ( void )
Example code:
<?php header("Expires: Sat, 12 Dec 1989 05:30:00 GMT"); echo "This is some output.<br />"; echo "Headers sent are:<br /> <UL>"; $headers = headers_list(); foreach($headers as $header) { echo "<LI>$header</LI>"; } echo "</UL>"; ?>
