Current Location: Home> Function Categories> flush

flush

Refresh the system output buffer
Name:flush
Category:Output buffer control
Programming Language:php
One-line Description:Try sending contents in the system output buffer to the browser.

Definition and usage

The lush() function requests the server to send its currently buffered output to the browser. Server configuration may not always allow this to happen.

Example

Output a string to the browser before the script is finished running:

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

// Use flush() to send strings to the browser
flush ( ) ;

// Show the rest in three seconds
sleep ( 3 ) ;
echo "<br>" ;
echo "Hello World!" ;
?>

Try it yourself

grammar

 flush ( ) ;
Similar Functions
Popular Articles