note 101652 added to function.rmdir
| From: | tra_neo at osu1 dot php dot net | Date: | Sun, 02 Jan 2011 15:48:02 +0000 |
| Subject: | note 101652 added to function.rmdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175394@lists.php.net to get a copy of this message | ||
remove directory and all sub's and files.
the two items commented is for show the item and the sub-directory deleted, os if you want see what
is remove.. uncomment those two lines.
function remove_dir($path)
{
if (is_dir($path))
{
$dir = scandir($path);
foreach($dir as $file)
{
if ($file != '.' and $file != '..')
{
if (is_dir($path.$file))
{
remove_dir($path.$file.'/');
rmdir($path.$file);
//echo "$path.$file\n<br>";
}
else
{
unlink($path.$file);
//echo "$path.$file\n<br>";
}
}
}
}
}
----
Server IP: 69.147.83.197
Probable Submitter: 200.18.33.229
----
Manual Page -- http://www.php.net/manual/en/function.rmdir.php
Edit -- https://master.php.net/note/edit/101652
Del: integrated -- https://master.php.net/note/delete/101652/integrated
Del: useless -- https://master.php.net/note/delete/101652/useless
Del: bad code -- https://master.php.net/note/delete/101652/bad+code
Del: spam -- https://master.php.net/note/delete/101652/spam
Del: non-english -- https://master.php.net/note/delete/101652/non-english
Del: in docs -- https://master.php.net/note/delete/101652/in+docs
Del: other reasons-- https://master.php.net/note/delete/101652
Reject -- https://master.php.net/note/reject/101652
Search -- https://master.php.net/manage/user-notes.php