Current Location: Home> Function Categories> ob_implicit_flush

ob_implicit_flush

Turn on/off implicit refresh
Name:ob_implicit_flush
Category:Output buffer control
Programming Language:php
One-line Description:Turn the implicit flush on or off.

Definition and usage

The ob_implicit_flush() function is used to enable or disable implicit refresh.

When enabled, an implicit refresh will send the output to the browser immediately when it is generated, so that there is no need to call the flush() function.

Example

Send content to the browser immediately on each statement that produces the output:

 <?php
// Turn on implicit refresh
ob_implicit_flush ( 1 ) ;

// If the content is too short, some browsers will not display the content
// We use str_pad() to make the output long enough
echo str_pad ( "Hello World!" , 4096 ) ;

// Even if the script is still running, the browser can already see the content
sleep ( 3 ) ;
?>

grammar

 ob_implicit_flush ( flag ) ;
parameter describe
flag When set to 1, implicit refresh is enabled. When set to 0, implicit refresh is disabled.
Similar Functions
Popular Articles