All Vskills Certification exams are ONLINE now. You may take from any where any time | Please use #TOGETHER for 20% discount

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);