Copyright © tutorialspoint.com
| bool fflush ( resource $handle ); |
This function forces a write of all buffered output to the resource pointed to by the file handle.
| Parameter | Description |
|---|---|
| handle | The file pointer must be valid, and must point to a file successfully opened by fopen() or fsockopen() (and not yet closed by fclose()). |
Returns TRUE on success or FALSE on failure.
Following is the usage of this function:
<?php
if ($f = fopen('myfile.txt', 'r')) do {
$line = fgets($f);
echo "$line";
// do any stuff here...
} while (!feof($f));
fflush($f);
// do any stuff here...
fclose($f);
?>
|
This will produce following result:
Copyright © tutorialspoint.com