How can i force my browser (or server) to output the result as soon as it becomes available ? such as .. for ($i=0; $i<1000; $i++) { // do a heavy operation here echo $result; } PHP: the problem is i always get chunks of results .. seems like it does some 10-20 (or any other number... randomly) passes trough the loop and then outputs a chunk of result, then does the next chunk, etc .. i want it to show me the output each and every time it goes trough the loop is it a browser setting i should change or is it a server setting i should change ? Thanks
Its server setting, try adding this to the beginning of your script ob_implicit_flush(1); ob_end_flush(); PHP: