PHP » I/O » fclose()

Syntax:
bool fclose(int file)
file
File handle of the file to close.

Closes a file.

fclose() is used on file handles to close files. It returns TRUE on success and FALSE on failure.

Examples

Code:
<?php

$logfile = fopen("log.txt", "r");
// read the file
if (fclose($logfile))
   print "File closed";

?>
Output:
File closed
Explanation:

A file is opened and closed.

See Also: