How to get the content of the output buffer in PHP

1 Answer

0 votes
ob_start();

echo "PHP ";

$ob1 = ob_get_contents();

echo "Output Buffer";

$ob2 = ob_get_contents();

ob_end_clean();

echo $ob1 . "<br />";
echo $ob2;
 
/*
run:
    
PHP 
PHP Output Buffer 
       
*/

 



answered Jul 14, 2016 by avibootz

Related questions

1 answer 220 views
1 answer 224 views
1 answer 256 views
1 answer 194 views
...