Certified PHP Developer Learning Resources Closing a file

Closing a file
 


Close a File

The fclose() function is used to close an open file

copy$my_file = 'file.txt';
$handle = fopen($my_file, 'w') or die('Cannot open file:  '.$my_file);
//write some data here
fclose($handle);

 

 For Support