I've never used these commands before and somebody gave me a chunk of code them with. I read the doc on php.net, which says it flushes the output buffer - what the hell does that mean? There's no explanation about what 'flushing the output buffer' means or why I would want to do it. Thanks
Flush() sends all output to browser immediately, without waiting for the end of the script. Basically the use of this command is to update browser with new content. for Example: <?php echo "Loading...<BR>"; flush(); sleep(2); echo "Loading Done...<BR>"; flush(); sleep(2); echo "Done!"; ?> PHP: ob_flush it requires ob_start command to be executed first before using this command. ob_start() begins making caches and prevents anything to show on browser until until ob_flush() is called. Example: <span>Start</span> <?php ob_flush(); ?> <span>END</span> <?php ob_flush(); ?> PHP: Thanks hope it helps
Ohhh....cool I've always wondered about that gets done So if ob_flush requires you to ob_start first, what's the point of using this command? Is there any benefit to using it over the flush command?
If you want to show your PHP page completely, not one after other content, then you may use ob_flush.