Is there any way to have PHP automatically call a function, before a script outputs any HTTP headers?
I'm looking for something like register-shutdown-function, but to register a function that's called before the output is already sent, not after. I want my function to send a header, so I need something that's called earlier.