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 Quote 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. Quote 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 Quote 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 Quote 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. Quote 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 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 Quote 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 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. Quote 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 Quote 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 i didn't found please copy the spesipic function thank Look in the user comments section its the first post.. Quote Link to comment https://forums.phpfreaks.com/topic/129066-how-to-copy-fonlder/#findComment-670183 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.