PHP fflush() Function
In this chapter you will learn:
- Definition for PHP fflush() Function
- Syntax for PHP fflush() Function
- Parameter for PHP fflush() Function
- Return for PHP fflush() Function
- Example - Writes all buffered output to an open file
Definition
The fflush() function writes all buffered output to an open file.
Syntax
PHP fflush() Function has the following syntax.
fflush(file)
Parameter
Parameter | Is Required | Description |
---|---|---|
file | Required. | Open file stream to check |
Return
PHP fflush() Function returns TRUE on success and FALSE on failure.
Example
Writes all buffered output to an open file
<?php// j a va 2 s . c o m
$file = fopen("test.txt","r+");
// some code
fflush($file);
?>
Next chapter...
What you will learn in the next chapter:
- Definition for PHP fgetc() Function
- Syntax for PHP fgetc() Function
- Parameter for PHP fgetc() Function
- Return for PHP fgetc() Function
- Example - Read one a character from a file
- Example - Read file character by character
Home » PHP Tutorial » PHP File Functions