Home  >  Article  >  php教程  >  php fflush 函数

php fflush 函数

WBOY
WBOYOriginal
2016-06-13 11:17:161365browse

php fflush 函数  

fflush
( PHP 4中“ = 4.0.1 , PHP 5中)

fflush -刷新输出到一个文件

描述
布尔fflush (资源$处理)
此功能部队写入所有缓冲输出的资源所指向的文件句柄。

参数

把柄
文件指针必须有效,必须指向一个文件成功打开fopen ( )或者fsockopen ( ) (和尚未关闭fclose ( ) ) 。


返回值
返回TRUE或FALSE的成功失败。

实例

例如1号文件的写例如使用fflush ( )、

$filename = 'bar.txt';

$file = fopen($filename, 'r+');
rewind($file);
fwrite($file, 'Foo');
fflush($file);
ftruncate($file, ftell($file));
fclose($file);
?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php fgetc 函数Next article:php fscanf 函数