fflush

Flushes the output to a file

&reftitle.description; `bool` `fflush` `resource` `stream`

This function forces a write of all buffered output to the resource pointed to by the file `stream`.

&reftitle.parameters;

`stream`

- &fs.validfp.all;
&reftitle.returnvalues;

&return.success;

&reftitle.examples;

### File write example using `fflush`

    <?php
    $filename = 'bar.txt';

    $file = fopen($filename, 'r+');
    rewind($file);
    fwrite($file, 'Foo');
    fflush($file);
    ftruncate($file, ftell($file));
    fclose($file);
    ?>

&reftitle.seealso;

- `clearstatcache`
- `fwrite`