<?php
function recursive_files_copy($source_dir, $destination_dir)
{
$dir = opendir($source_dir);
@mkdir($destination_dir);
while($file = readdir($dir))
{
if(($file != '.') && ($file != '..'))
{
if(is_dir($source_dir.'/'.$file))
{
recursive_files_copy($source_dir.'/'.$file, $destination_dir.'/'.$file);
}
else
{
copy($source_dir.'/'.$file, $destination_dir.'/'.$file);
}
}
}
closedir($dir);
}
$source_dir = "/home/gowri/folder_1";
$destination_dir = "/home/gowri/folder_2";
recursive_files_copy($source_dir, $destination_dir);
?>