How can i make this script delete a folder thats within a folder the production folder has a folder called twig inside it but fails to delete
<?php
// Deletes everything but index.htm and .htaccess from the phpBB cache directory
$cachedir = "cache/production";
$dir = opendir($cachedir);
// Delete everything but index.htm and .htaccess
while( $file = readdir( $dir ) ) {
if ($file == "." or $file == ".." or $file == "index.htm" or $file == ".htaccess") {
continue;
}
echo "Deleting $cachedir/$file ... ";
if (unlink("$cachedir/$file")) {
echo "Done.<BR>";
} else {
echo "Not done.<BR>";
}
}
?>