I have some code which does the following:
<?php
ob_flush();
ob_start();
echo $something;
ob_end_flush();
echo $another_thing;
?>
I can see $something
but not $another_thing;
According to the manual ob_end_flush() just turns off output buffering, so if that's the case, why can't I see $another_thing;
just the same as if I'd written without any output buffering:
<?php
echo $something;
echo $another_thing;
?>
Although I saw no reason why this should work, I decided to try calling flush()
and ob_flush()
after echo $another_thing;
but this didn't help either.
What is the correct way to do this, and why doesn't the above work?
Thanks