how to show script output while running (ob_flush stuff)
Posted: Wed Feb 08, 2006 7:48 am
Ok
I am really having problem with this stuff
I want to display echos for example while running an foreach.
having sleep for example to actually see that the flush is working.
10x
how could I make this script show me "Hello"
and after 2 seconds "World".
Thanks a lot
I am really having problem with this stuff
I want to display echos for example while running an foreach.
having sleep for example to actually see that the flush is working.
10x
Code: Select all
ob_start();
echo "Hello ";
$out1 = ob_get_contents();
sleep(2);
echo "World";
$out2 = ob_get_contents();
ob_end_clean();
var_dump($out1, $out2);and after 2 seconds "World".
Thanks a lot