Renames a file.
rename() renames a file. TRUE is returned on success. If an error occurs, FALSE is returned.
<?php
if (rename("log2.txt", "backup/logbackup.txt")) {
print "File renamed";
}
?> File renamed This code renames a file and moves it to the backup directory.