void fclose ( resource $handle );
$myfile = fopen("example.txt", "r"); //perform file read operations fclose($myfile); //close the open file
$files = array('file1.txt', 'file2.txt', 'file3.txt'); foreach($files as $file) { $handle = fopen($file, "r"); //perform file read operations fclose($handle); //close the open file }Package Library: The fclose() function is a core PHP function and is included in the PHP Standard Library, which means we don't need to include any additional package or library to use it.