<?
function move_d($source,$target)
{ if(is_dir($source)){ $dest_name=basename($source); if(!mkdir($target.$dest_name)){ return false; } $d=dir($source); while(($entry=$d->read())!==false){ if(is_dir($source.$entry)){ if($entry=="."||$entry==".."){ continue; }else{ move_d("$source$entry//","$target$dest_name//"); } }else{ if(!copy("$source$entry","$target$dest_name//$entry")){ return false; } } } }else{ if(!copy("$source$entry","$target$dest_name//")){ return false; } } return true; }
?>
function move_d($source,$target)
{ if(is_dir($source)){ $dest_name=basename($source); if(!mkdir($target.$dest_name)){ return false; } $d=dir($source); while(($entry=$d->read())!==false){ if(is_dir($source.$entry)){ if($entry=="."||$entry==".."){ continue; }else{ move_d("$source$entry//","$target$dest_name//"); } }else{ if(!copy("$source$entry","$target$dest_name//$entry")){ return false; } } } }else{ if(!copy("$source$entry","$target$dest_name//")){ return false; } } return true; }
?>