How to flush the output to a file with fflush() in PHP

1 Answer

0 votes
$file = fopen("d:\\data.txt", 'r+');
rewind($file);
fwrite($file, "codeing is fun\r\n");
fwrite($file, "C, Java, C#, PHP");
fflush($file);
fclose($file);


/*
run: 

// data.txt:
codeing is fun
C, Java, C#, PHP

*/

 



answered Jun 16, 2016 by avibootz

Related questions

...