Вы можете попробовать:
$from = './test/'; //replace with absolute path if better
$to = './new/';
$paths = array('library/main/single/list.php', 'library/article/grid/thumbs.php', 'library/footer/tiny.php');
$dirs = array();
foreach( $paths as $path ) {
$pathinfo = pathinfo($to.$path);
if (!in_array($pathinfo['dirname'], $dirs) && !file_exists($pathinfo['dirname']) && mkdir($pathinfo['dirname'], 0777, true))
$dirs[] = $pathinfo['dirname'];
copy($from.$path, $to.$path);
}