 |
|
|  |
| 디렉토리내의 모든 파일 및 폴더 삭제 함수 (Recursive call) |
|
|
 |
15년 전 |
Blackboard에 사용되는 common function중에 하나..
/* remove files or directories recursively */
function remove_all( $path )
{
if( is_file($path) )
{
unlink($path);
}
elseif( is_dir($path) )
{
$dir = opendir($path);
while ($file = readdir($dir))
{
if( $file!="." && $file!=".." )
{
/* remove all recursively */
remove_all($path."/".$file);
}
}
closedir($dir);
rmdir($path);
}
else
{
return FALSE;
}
}
|
|
추천 : 817 |
추천
목록
|
|
|  |
|