Hey, well I don’t really know how to describe this but here’s my current situation.
On my old host, I could have a loop going and echo things in the loop. As the code was running that loop, the text i was echoing would appear right away and I could see things happening.
Now though, on my current host if I have a loop like that I only see the text that was being echoed once the loop is done and the script is fully done executing.
I was just wondering if anyone knows why?
Thanks!
edit: output buffering and output compression is off.
As others have said, it sounds like output buffering is on by default on your host.
You can turn it off programatically, using ob_end_flush() (which sends any buffered output), or ob_end_clean() (which will discard any output). Calling one of those functions early in your code (at the top of your script, or in some config file, for example) will get you at least part of the way there.
You may also be able to turn off output buffering in php.ini, or by setting
php_value output_buffering Offin an .htaccess file, if you wanted to turn it off globally.As Tobias P. points out, you can then use flush() to (try to) force whatever PHP is hooked up to (apache, CGI etc) to flush the output as well.