Code Snippet > PHP

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;

Source: http://php.net/manual/en/function.ob-start.php



Show Some Love, Spread This Post!

0 comments

Leave a comment

Have something to say? Drop a comment! No HTML tags are allowed in the comment textfield.

Advertisement