Using ob_start Output Buffering in PHP

This is really useful when we have a long text and you want to output large amount of text. I always forget about this one so I should put it here as a future reference.

PHP

ob_start();			

echo 'Put your text here';

$body = ob_get_contents();
ob_end_clean();	

echo $body;

Share the love

Leave a Comment

Please keep in mind that comments are moderated and rel="nofollow" is in use. You can use [code][/code] if you want to write codes. Don't spam us :) Thanks!

Advertisement