The fflush() function writes all buffered output to an open file.
PHP fflush() Function has the following syntax.
fflush(file)
Parameter | Is Required | Description |
---|---|---|
file | Required. | Open file stream to check |
PHP fflush() Function returns TRUE on success and FALSE on failure.
Writes all buffered output to an open file
<?php
$file = fopen("test.txt","r+");
// some code
fflush($file);
?>