Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

fflush()

Example

Write all buffered output to the open file.

<?php
$file = fopen(“test.txt”,“r+”);
rewind($file);
fwrite($file, ‘Hello World’);
fflush($file);

fclose($file);
?>

Definition and Usage

The fflush() function writes all buffered data to an open file.

Syntax

fflush(file)

Parameter Values

 

Parameter

Description

file

Mandatory. Specifies the open file to which the buffered output should be written.

Technical Details

Return Value:

Returns TRUE on success and FALSE on failure.

PHP Version:

4.0.1+