fflush() - 语法

bool fflush ( resource $handle );

此函数强制将所有缓冲输出写入文件句柄所指向的资源。

handle.      -  文件指针必须有效,并且必须指向通过fopen()fsockopen()成功打开的文件(但尚未被fclose()关闭)。

fflush() - 返回值

成功时返回TRUE,失败时返回FALSE。

fflush() - 示例

<?php
   if ($f=fopen('sample.txt', 'rw')) do {
      $l=fgets($f);
      echo "$l";
      
      //do any stuff here...
   }
   
   while (!feof($f));
   fflush($f);
   
   //do any stuff here...
   fclose($f);
?>

参考链接

https://www.learnfk.com/php/php-function-fflush.html