Possible Duplicate:
PHP: how to know if output already started?
I would like to find out if there is already generated output in the buffer before I start the session.
In PHP, an output that started before the session started always creates a warning, for example a bug in the controller creates this output:
Warning:
fopen(/tmp/test.txt)
[function.fopen]: failed to open stream: Permission denied in
/var/www/app/controllers/test_controller.php on line 836Warning: Cannot modify header information – headers already sent by
(output started at test.php:836) in layouts/default.thtml on line 18
This is not the problem, I like that warning so I find out some bugs.
But my layout is designed like that there is a fixed bar at the top of the page that covers the first warning. so I would like to find out if there is already generated output in the buffer before I start the session, so I can quit adding the style fixed to that bar.
There is a function for that:
headers_sent.