PHP output buffering? What's the best practise?
<p>Further to my <a href="http://stackoverflow.com/questions/3278250/how-can-i-detect-if-any-output-has-been-written-and-how-can-i-redirect-if-it-has">previous question</a>, what's the best approach when I want to buffer PHP output until I have performed all processing? I want to buffer to leave myself the option to to redirect to an error page, which I can't do after any output.</p>

<p>So, what's the best practise?  Use a variable <code>$output</code> and keep appending to it, then output it at the end? Or use ob_str(), etc? </p>

<p>Is there a peformance to choose code-maintainability reason for one over the other? Or is it just personal preferance?</p>
