PHP fflush() 函数

定义和用法
fflush() 函数将缓冲内容输出到文件。
语法
fflush(file)
参数 | 描述 |
---|---|
file | 必需。规定要检查的文件流。 |
说明
本函数强制将所有缓冲的输出写入 file 文件句柄所指向的资源。如果成功则返回 true,否则返回 false。
文件指针必须有效,并且必须指向一个由 fopen() 或 fsockopen() 成功打开(但还没有被 fclose() 关闭)的文件。
例子
<?php
file = fopen("test.txt","r+");
// 一些代码
fflush($file);
?>
file = fopen("test.txt","r+");
// 一些代码
fflush($file);
?>
