Young thanks for the explanation.
However the code below (without ob_start()) also produce the same effect i.e. it displays all the numbers together at the end of the script like this 1,2,3,4,5,
Code:
<?php
for($i=1;$i<=5;$i++)
{
echo $i. ",";
sleep(1);
}
?>
If we are NOT using ob_start(), it should display the numbers one at a time like this:
Code:
1,
1,2,
1,2,3,
1,2,3,4,
1,2,3,4,5, [final output]
Sorry but I am still confused with this particular example. I mean why the script is still holding the output even when we are NOT using ob_start()?
Bookmarks