In PHP you can get contents of an output buffer using ob_get_contents(). The usage is given below:

ob_start();
echo "Schogini Inc";
$out_buffer = ob_get_contents();
ob_end_clean();
var_dump($out_buffer);

 

That’s it.