• PHP Video Tutorials

PHP - Function fflush()



The fflush() function writes all the buffered output to an open file, and it can returns true on success or false on failure.

Syntax

bool fflush ( resource $handle )

This function forces a write of all the buffered output to resource pointed to by the filehandle.

Example

<?php
   $file = fopen("/PhpProject/sample.txt", "r+");

   // some code
   fflush($file);
   
   echo $file;
   fclose($file);
?>

Output

Resource id #5
php_function_reference.htm
Advertisements