данная функция удаляет папки и пустые, и даже если в ней есть файлы и папки

                        
<?php
function RemoveDir($path)
{
if(file_exists($path) && is_dir($path))
{
$dirHandle = opendir($path);
while (false !== ($file = readdir($dirHandle)))
{
if ($file!='.' && $file!='..')
{
$tmpPath=$path.'/'.$file;
chmod($tmpPath, 0777);

if (is_dir($tmpPath))
{
RemoveDir($tmpPath);
}
else
{
if(file_exists($tmpPath))
{
unlink($tmpPath);
}
}
}
}
closedir($dirHandle);

if(file_exists($path))
{
rmdir($path);
}
}
}
?>
2 5 0
0

Нет фото
• 17 мар 2013, 01:07


Сам знаешь *

0

Нет фото
• 17 мар 2013, 00:49


А вручную нельзя? *