PHP fflush() Function
❮ PHP Filesystem ReferenceExample
Write all buffered output to the open file:
<?php
$file = fopen("test.txt","r+");
rewind($file);
fwrite($file, 'Hello World');
fflush($file);
fclose($file);
?>
Definition and Usage
The fflush() function writes all buffered output to an open file.
Syntax
fflush(file)
Parameter Values
| Parameter | Description |
|---|---|
| file | Required. Specifies the open file to write the buffered output to |
Technical Details
| Return Value: | TRUE on success, FALSE on failure |
|---|---|
| PHP Version: | 4.0.1+ |
❮ PHP Filesystem Reference