note 109399 deleted from function.rmdir by danbrown

From: Date: Mon, 16 Jul 2012 15:19:51 +0000
Subject: note 109399 deleted from function.rmdir by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189180@lists.php.net to get a copy of this message
Note Submitter: Aquarius ---- clearer Anonymous 23-Jan-2012 03:20 ;) <?PHP function rrmdir($dir) // $dir = dir or file { if(is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if($object != '.' AND $object != '..') { if (filetype($dir.'/'.$object) == 'dir') rrmdir($dir.'/'.$object); else unlink($dir.'/'.$object); } } reset($objects); rmdir($dir); } elseif(is_file($dir)) unlink($dir); } ?>

« previous php.notes (#189180) next »