(PHP 4 >= 4.0.1, PHP 5, PHP 7)
fflush — Flushes the output to a file
$handle
)
This function forces a write of all buffered output to the resource
pointed to by the file handle
.
성공 시 TRUE
를, 실패 시 FALSE
를 반환합니다.
Example #1 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);
?>