adam291086 Posted September 8, 2008 Share Posted September 8, 2008 I found this function ages ago through google function full_copy($source, $target,$new ) { if (is_dir($source ) ) { @mkdir($target ); $d = dir($source ); while (FALSE !== ($entry = $d->read() ) ) { if ($entry == '.' || $entry == '..' ) { continue; } $Entry = $source . '/' . $entry; if (is_dir($Entry ) ) { full_copy($Entry, $target . '/' . $entry ); continue; } copy($Entry, $target . '/' . $entry ); } $d->close(); } else { copy($source, $target ); } } Heres the problem if i have the following folder structure Folder Adam which contains Folder john file adam.php file index.php Folder john contains file index.php When i go to call on the function all the files and folders within Adam are copied across but not into a folder called Adam there is just the folder called john with its files and the other two files. I know i need to mkdir($source) at the start of the function but i am stuck with how to get everything to go into that folder. Link to comment https://forums.phpfreaks.com/topic/123232-moving-a-whole-dir/ Share on other sites More sharing options...
adam291086 Posted September 9, 2008 Author Share Posted September 9, 2008 anyone? Link to comment https://forums.phpfreaks.com/topic/123232-moving-a-whole-dir/#findComment-637326 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.