unlink folder in php code example
Example 1: php recursively delete directory
function removeDirectory($path) {
$files = glob($path . '/*');
foreach ($files as $file) {
is_dir($file) ? removeDirectory($file) : unlink($file);
}
rmdir($path);
return;
}
Example 2: php unlink
<?php
unlink('test.html');
?>