note 52355 added to function.mkdir
| From: | webmaster2007 at home dot nl | Date: | Thu, 28 Apr 2005 15:27:56 +0000 |
| Subject: | note 52355 added to function.mkdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-88698@lists.php.net to get a copy of this message | ||
Maybe you can use this:
<?php
function open_dir($dir, $newdir){ //The function that will copy the files
if(file_exists($dir) && file_exists($newdir)){
$open_dir=opendir($dir);
while (false !== ($file = readdir($open_dir))) {
if($file != "." && $file != ".."){
if(file_exists($newdir."/".$file) &&
filetype($newdir."/".$file."/") != "dir"){
unlink($newdir."/".$file);
}
if(filetype($dir."/".$file."/") == "dir"){
if(!file_exists($newdir."/".$file."/")){
mkdir($newdir."/".$file."/");
open_dir($dir."/".$file."/", $newdir."/".$file."/");
}
}
else {
copy($dir."/".$file."/", $newdir."/".$file);
}
}
}
}
}
open_dir("Your source map", "Your destination map"); //Here you can fill in
your source en destination map
?>
----
Manual Page -- http://www.php.net/manual/en/function.mkdir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52355
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52355&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52355&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52355&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52355&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52355&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52355&report=yes
Search -- http://master.php.net/manage/user-notes.php