Current Location: Home> Function Categories> fclose

fclose

Close an open file pointer
Name:fclose
Category:File system
Programming Language:php
One-line Description:Close the open file.

Definition and usage

fclose() function closes an open file.

Example

 <?php
$file = fopen ( "test.txt" , "r" ) ;

//Some code executed...

fclose ( $file ) ;
?>

grammar

 fclose ( file )
parameter describe
file Required. Specifies documents to be closed.

illustrate

The file parameter is a file pointer. The fclose() function closes the file pointed to by the pointer.

Return true if successful, otherwise return false.

The file pointer must be valid and is successfully opened via fopen() or fsockopen() .

Similar Functions
Popular Articles