Why save output until the end?
        Posted  
        
            by 
                user509006
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user509006
        
        
        
        Published on 2011-01-05T03:18:21Z
        Indexed on 
            2011/01/05
            3:53 UTC
        
        
        Read the original article
        Hit count: 202
        
php
|output-buffering
Very quick question about programming practices here:
I've always used echo() to output HTML code to the user as soon as it was generated, and used ob_start() at the same time to be able to output headers later in the code. Recently, I was made aware that this is bad programming practice and I should be saving HTML output until the end.
Is there a reason for this? What is it, and why isn't output buffering a good alternative?
Thanks!
© Stack Overflow or respective owner