Copying Files In A Directory
Moderator: General Moderators
-
andylyon87
- Forum Contributor
- Posts: 168
- Joined: Sat Jan 31, 2004 5:31 am
- Location: Dundee
Copying Files In A Directory
How do I go about copying a file to another folder say from a dir called "form_data" to a dir called "moderated". Both these folders are within a folder called "test". I want files to move from the "form_data" folder to the "moderator" folder.
rename('test/form_data/file1.txt', 'test/moderated/file1.txt');
This will 'move' it by the way, not sure if you want to copy or move as you mention both
If you want to copy then see http://php.net/copy
This will 'move' it by the way, not sure if you want to copy or move as you mention both
-
andylyon87
- Forum Contributor
- Posts: 168
- Joined: Sat Jan 31, 2004 5:31 am
- Location: Dundee
Yeah, that's what http://php.net/rename does
-
andylyon87
- Forum Contributor
- Posts: 168
- Joined: Sat Jan 31, 2004 5:31 am
- Location: Dundee