- after all stuff behind is run
- immediately
Which is the case? Can anyone verify this?
Which is the case? Can anyone verify this?
depends on the output_buffering setting
headers_sent()
function can verify
If output buffering is disabled then it will be sent immediately. It must be sent before any other content (however you can perform processing logic before sending the header)
Depends on output buffering, but the PHP interpreter still only uses them after having interpreted all the code before, just like a normal function. Still, there must not be any HTML before a header()
, or things will screw up.
To make sure that a page is directly redirected, add a exit; after the header.