unlink nie skasuje katalogu z plikami.
Do autora topicu, czasem bardzo owocne jest czytanie komentarzy w manualu. Jest tam piękny przykład, nie jestem jego autorem:
<?
function rmdirRecursive($path,$followLinks=false) {
if ( is_file( \"$path/$entry\" ) || ((!$followLinks) && is_link(\"$path/$entry\")) ) { echo ( \"unlink $path/$entry;n\" ); // Uncomment when happy!
//unlink( \"$path/$entry\" );
} elseif ( is_dir( \"$path/$entry\" ) && $entry!='.' && $entry!='..' ) { rmdirRecursive( \"$path/$entry\" );
}
}
echo \"rmdir $path;n\"; // Uncomment when happy!
// return rmdir($path);
}
?>