Call a function before outputting headers in PHP?
<p>Is there any way to have PHP automatically call a function, before a script outputs any HTTP headers?</p>

<p>I'm looking for something like <a href="http://us.php.net/register-shutdown-function" rel="nofollow">register-shutdown-function</a>, but to register a function that's called <strong>before</strong> the output is already sent, not after. I want my function to send a header, so I need something that's called earlier.</p>
