Originariamente inviato da powerflash2
con l'ob_get_contents prendo il contenuto del buffer e lo metto dentro una variabile, giusto?
Si.
Esempio:
Codice PHP:
<?php
// start an output buffer
ob_start();
// echo some output that will be stored in the buffer
echo "This text is in the buffer!
";
echo "This text is in the buffer 2!
";
// store buffer content in a variable
$bufferContent = ob_get_contents();
//stop and clean the output buffer
ob_end_clean();
echo "This text is not in the buffer!
";
echo $bufferContent;
echo 'other output';
?>