I'm trying to build a templating system and I know a common way of doing it is to turn on output buffering, output the template file, capture the output, then turn off buffering. I'm trying that but the output is getting through anyway. Here's some sample code:
Code: Select all
ob_start();
echo "test";
$output = ob_get_flush();
$output = "This is a ".$output;
echo $output;I've checked php.ini and there is no value for output_buffering. So, I've called:
Code: Select all
ini_set("output_buffering","on");I know buffering is on because ob_get_flush() returns false if buffering isn't on - and it's obviously returning what it should.
Any ideas?