Delete Directory
This procedure by Wm_chief original, if want to reprint, please indicate author and source (http://www.phome.net)
Class Del_path
{
function Wm_chief_delpath ($del _path)
{
if (!file_exists ($del _path))//target directory does not exist then establish
{echo "directory does not exist"; return false;}
$hand =opendir ($del _path);
$i = 0;
while ($file =readdir ($hand))
{$i + +;
if ($i ==1| | $i ==2)
{continue;}
if (! ( STRCHR ($file, ".")))
{
$del _s_path= $del _path. " /". $file;
$this->wm_chief_delpath ($del _s_path);
}
Else
{
$del _file= $del _path. " /". $file;
$this->wm_chief_file ($del _file);
}
}
Closedir ($hand);
$this->wm_chief_path ($del _path);
return true;
}
deleting files
function Wm_chief_file ($del _file)
{
Unlink ($del _file);
}
Delete Directory
function Wm_chief_path ($del _path)
{
RmDir ($del _path);
}
}
$DelPath = "Delpath";//directory to be deleted
$WM _chief=new Del_path ();
$WM _chief_ok= $wm _chief->wm_chief_delpath ($DelPath);
if ($WM _CHIEF_OK)
{
echo "Delete Complete";
}
http://www.bkjia.com/PHPjc/313731.html www.bkjia.com true http://www.bkjia.com/PHPjc/313731.html techarticle ?//Delete directory//This program by Wm_chief original, if you want to reprint, please indicate the author and source (http://www.phome.net) Classdel_path {Functionwm_chief_delpath ($del _ Path) {if (!file_exists ($ ...