PHP File Close
From w3cyberlearnings
Contents |
PHP close a File
You have to close a file after you have open or use it. It is a good practice to always close a file, because if you keep it open after you used it, the open file is still running on your server and it takes your server resources.
Syntax fclose
fclose(filehandle)
Example 1
<?php $filename = "myfirstfile.txt"; $filehandle = fopen($filename, 'w') or die("can't open file"); fclose($filehandle); ?>