Wild guess from the side-lines
....
This may be a browser issue.
Typical of browsers to accept unformatted text as an entire
block until a recognized tag is found.
try something like ... $buffer .= "<div>".$_."</div>";
Regards,
Comment on Re: Long Process Waits Until End to Display Results