Home > Backend Development > PHP Tutorial > php fflush function_PHP tutorial

php fflush function_PHP tutorial

WBOY
Release: 2016-07-20 11:01:02
Original
1146 people have browsed it

php fflush function ​

ffflush
(PHP 4" = 4.0.1, PHP 5)

fflush - Flushes output to a file

Description
boolean fflush (resource$process)
This function forces writing of all buffered output to the file handle pointed to by the resource.

Parameters

Handle
The file pointer must be valid and must point to a file successfully opened by fopen() or fsockopen() (and not yet closed by fclose()).


Return value
Returns TRUE or FALSE on success or failure.

Example

For example, to write file No. 1, use fflush ( ),

$filename = 'bar.txt';

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


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/445480.htmlTechArticlephp fflush function fflush (PHP 4 = 4.0.1, PHP 5) fflush - flush output to a file Description boolean fflush(resource$handled) This function forces writing of all buffered output resources...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template