English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP fflush() 函数用法及示例

PHP Filesystem 参考手册

fflush()函数将所有缓冲的输出写入打开的文件,如果成功,则返回true,否则返回false。

语法

bool fflush ( resource $handle )

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

在线示例

<?php
   $file = fopen("/PhpProject/sample.txt", "r+");
   // some code
   fflush($file);
   echo $file;
   fclose($file);
?>

输出结果

Resource id #5

PHP Filesystem 参考手册