yolop Posted October 19, 2008 Share Posted October 19, 2008 i know how to copy files... <?php $file = '1.php'; $newfile = '2.php'; if (!copy($file, $newfile)) { echo "failed to copy $file...\n"; } ?> but I want to copy folder with the files that in the folder that function don't do that please help Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/ Share on other sites More sharing options...
wildteen88 Posted October 19, 2008 Share Posted October 19, 2008 I don't think there is a built in function for copying folders. Instead you'll have to first create a new directory then loop through all the files in the folder your want to copy to the new folder. Once you have copied all files delete the old folder. Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669149 Share on other sites More sharing options...
ghostdog74 Posted October 19, 2008 Share Posted October 19, 2008 take a look here Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669164 Share on other sites More sharing options...
yolop Posted October 19, 2008 Author Share Posted October 19, 2008 that copy only files not folder Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669201 Share on other sites More sharing options...
trq Posted October 19, 2008 Share Posted October 19, 2008 Have a look at the user examples on the copy man page. The one at the top ought help you out. Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669207 Share on other sites More sharing options...
yolop Posted October 19, 2008 Author Share Posted October 19, 2008 Quote Have a look at the user examples on the copy man page. The one at the top ought help you out. sorry i didn't find where Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669217 Share on other sites More sharing options...
trq Posted October 19, 2008 Share Posted October 19, 2008 Quote Quote Have a look at the user examples on the copy man page. The one at the top ought help you out. sorry i didn't find where Its the first user posted example you come to when scrolling downward. Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669224 Share on other sites More sharing options...
yolop Posted October 19, 2008 Author Share Posted October 19, 2008 i didn't found please copy the spesipic function thank Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-669607 Share on other sites More sharing options...
wildteen88 Posted October 20, 2008 Share Posted October 20, 2008 Quote i didn't found please copy the spesipic function thank Look in the user comments section its the first post.. Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-670183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.