php remove output buffering -
i doing lot of processing @ php page , want display progress information user, instance, finished 10% 20% , so. happening data displayed @ once after processing done, how can display right away!
i tried set comment out output buffer in php.ini
, tried use flush()
after echo
statements, not working, suggestions?
here code:
ob_start(); while ($line = read_file_line("c:/1.txt")) { $read_lines_count++; if($read_lines_count % 100 == 0) { echo "parsed $read_lines_count <br />"; ob_flush(); } }
first need call ob_start()
before code printed.
then echo whatever want
call ob_flush()
when want show buffer on screen.
and @ end, call ob_end_flush()
end buffering , show output.
make sure php.ini has line uncommented:
output_buffering = on
more info : http://www.php.net/manual/en/book.outcontrol.php
Comments
Post a Comment