Ok, I have a text file that gets updated daily. But, i need to keep the old text files for historical purposes. How can I do this in PHP?? I need to move the old file to a different directory and change the name to have the date on it
ie: old text file: test.txt
move to old_text_files/02-17-04.txt
then i need the new text file to be written in its place with the old name of test.txt.
Thanks
moving a text file
Moderator: General Moderators
Code: Select all
rename('test.txt',"old_text_files/".date("m-d-y")."txt");or use the
Code: Select all
copy()Code: Select all
copy("/usr/local/apache2/htdocs/text.txt", "/old_text_files/".date("m-d-y")."txt");