Jump to content

delete directories


Woodburn2006

Recommended Posts

found this:
[code]// returns true if folder is empty or not existing
// false if folde is full

function is_empty_folder($dir) {
if (is_dir($dir)) {
  $dl=opendir($dir);
  if ($dl) {
      while($name = readdir($dl)) {
  if (!is_dir("$dir/$name")) { //<--- corrected here
      return false;
      break;
      }
  }
      closedir($dl);
      }
  return true;
  } else return true;
}
[/code]

on http://uk2.php.net/is_dir

Liam
Link to comment
https://forums.phpfreaks.com/topic/19462-delete-directories/#findComment-84528
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.