Title is self-explanatory.
I have a good bit of experience with PHP, but I am not sure how the header
function works between ob_start()
and ob_end_clean()
.
Consider this:
ob_start();
echo "Some content";
header('X-Example-Header: foo');
echo "Some more content";
$output = ob_get_contents();
ob_end_clean();
echo $output;
Does the header
function ignore the output buffering, and thus all headers get sent before the content because it is echo
ed after the header
call?
Or does it work some other way?
ob_start
— This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer. – Tommy