Get echo'ed things in a variable

Sometime it's useful to get thing which would normally get rendered to the screen directly into a variable; here's how you can do that. <br/> It's a bit unorthodox but well...
1
2
3
ob_start();
echo 'Let\'s save that instead of displaying it!';
$content = ob_get_clean();
X

Language: PHP | User: haltabush | Created: Oct 3, 2013