Drop directory with PHP

From: Date: Sat, 04 Sep 2004 13:25:20 +0000
Subject: Drop directory with PHP
Groups: php.general 
Request: Send a blank email to php-general+get-195842@lists.php.net to get a copy of this message
Hi all I have create this function to delete directory and file but i have no result . When i call the function i don't receive any errors by PHP. I have test this function with PHP 4.3.6 and Apache for NT version 1.3.1 on Windows Xp Professional I write this code : <?php error_reporting(E_ALL); function DropDir($dir) { if (is_dir($dir)) { if (!($handle = opendir($dir)))
     die("It' no possible open directory  $dir");
while(false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..') {
     if (is_dir($dir . '/' . $file)) {
      DropDir($dir . '/' . $file);
      exec("rmdir $file");
     }
     else {
      exec("del $file");
     }
} } closedir($handle); exec("rmdir $dir"); } } //call function DropDir DropDir('my_folder'); ?> I think that it' impossible for me find solution to this problem. Can you help me ? Thanks so much to all an sorry for my bad language

« previous php.general (#195842) next »