Daniel Jones, 2017-11-07 11:42 AM
<?php
function remove_empty_subfolders($path) {
$path = rtrim($path, '/');
foreach(glob($path . "/*") as $subdir) {
if (is_dir($subdir)) {
if (!count(glob($subdir . "/*")))
rmdir($subdir);
}
remove_empty_subfolders($args[0]);
?>