I am writing a php script and somewhere before my header()
function i have printed text to the browser hereby causing my header()
function give me a well known error:
Warning: Cannot modify header information - headers already sent.
Now my question is, I have the intentions of using ob_start()
and ob_flush()
before and after the header()
function. But I once heard something like output buffer can affect the performance of one's application negatively. How true is that?
Or should I just stick with the idea of printing Javascript function to redirect the page.
Thanks for your time.