給像我一樣的 PHP 初學者的一些提示
由 fflush() 寫入的緩衝輸出與由 ob_start() 函式初始化的輸出緩衝區無關。
(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)
fflush — 將輸出刷新到檔案
範例 #1 使用 fflush() 的檔案寫入範例
<?php
$filename = 'bar.txt';
$file = fopen($filename, 'r+');
rewind($file);
fwrite($file, 'Foo');
fflush($file);
ftruncate($file, ftell($file));
fclose($file);
?>
給像我一樣的 PHP 初學者的一些提示
由 fflush() 寫入的緩衝輸出與由 ob_start() 函式初始化的輸出緩衝區無關。