function copydir($source,$destination){
if(!file_exists($destination)){
mkdir($destination, 01777); // so you get the sticky bit set
}
$dir_handle = @opendir($source) or die("Unable to open");
while ($file = readdir($dir_handle)){
if($file!="." && $file!=".." && $file!=".svn"){
if(is_dir("$source/$file")){
copydir("$source/$file","$destination/$file");
}else{
copy("$source/$file","$destination/$file");
}
}
}
closedir($dir_handle);
}
