php1 Posted September 19, 2008 Share Posted September 19, 2008 i want to copy a file from one directory to another using php. any ideas plz help <?php $source = "/var/www/html/source.txt"; $des = "/var/www/html"; cpy($source,4des); ?> Link to comment https://forums.phpfreaks.com/topic/124906-solved-how-to-copy-a-file-in-one-directory-to-another-directory/ Share on other sites More sharing options...
JasonLewis Posted September 19, 2008 Share Posted September 19, 2008 You're actually after copy(). <?php $source = "dir/to/original/file.txt"; $new = "new/dir/to/file_new.txt"; copy($source, $dir); ?> Link to comment https://forums.phpfreaks.com/topic/124906-solved-how-to-copy-a-file-in-one-directory-to-another-directory/#findComment-645417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.