Back PHP

Using ob_start Output Buffering in PHP

WRITTEN BY ON 06 Jan 2011
8,159 VIEWS • SHARES
0 comments

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;
Join the discussion

Comments will be moderated and rel="nofollow" will be added to all links. You can wrap your coding with [code][/code] to make use of built-in syntax highlighter.