ob_implicit_flush is your friend.
If you call the
at the start of your
PHP will automatically call
immediately after every
if you use mod_gzip or other output buffering (e.g. with
etc) then this is may not be for you! Because,
will disable output buffering. It really means "I want no buffering".
Note that calling
with no parameters is the same as calling
TRUE means turns on auto-flush.
Read the ob_implicit_flush documentation
for full info.
Read the documentation?! Just tell me how to use it!
Ok, sheesh. Put this at the start of your script and then you wou't have to call flush() every time
// TRUE = disable all output buffering,
// and automatically flush()
// immediately after every print or echo
How do I know if it's for me?
does what you want, then this will do what you want.
It just makes it so that you don't need to call flush anymore. If you find
yourself calling flush a lot, try this.
How do I know if it's NOT for me?
It's not for you if you use output buffering on purpose, because
disables all output buffering.
But isn't ob_implicit_flush just about ob_* calls? Does it really apply to flush, echo, and print calls?
ob_implicit_flush is about all output: flush, echo, and print included. Don't let the ob_ distract you!
It's not just about ob_* calls like ob_start and ob_flush, and ob_end_flush.
states: "explicit calls to flush() will no longer be needed" if you call it.
I hope this information helps your
PHP web development