ilUtil::rcopy($source_dir, $destination_dir);
ilUtil::rcopy($source_dir, $destination_dir, true, true);
$exclude_dirs = array('subdir1', 'subdir2'); ilUtil::rcopy($source_dir, $destination_dir, false, false, $exclude_dirs);In this example, $exclude_dirs is an array of subdirectory names that you want to exclude from the copy. ilUtil rCopy is part of the ILIAS package library, which is a collection of functions used in the ILIAS e-learning software. However, the function can also be used in any PHP project.