|
| HOW TO DELETE A FILE IN PHP
PHP provides an easy way to delete a file that you may no longer need. This is achieved by the unlink() function.
The unlink() function takes the file name as it's argument.
In order for unlink to work, you must first ensure that the file is already closed by using the fclose() function.
The general format is:
unlink(file name);
Example:
$TheFile="myfile.txt";
unlink($TheFile);
This will effectively delete the file myfile.txt.
|
|