Renaming and Removing Files
Removing Files
For renaming files, PHP has unlink() function to delete files.On a UNIX-like system the file will only be deleted if no programs have this file in use.
Example:
unlink(”file.txt”);
Renaming Files
- For renaming a file php has a a function rename()
- This function is automic which means that that nothing can interfere with this,and that it is always guaranteed not to be
interrupted.
Example
rename(’file1.txt’, ‘file2.txt’);
