code to remove files and folder from specified directory

by kalai 2010-03-02 20:35:00


function delTree($dir) {
$files = glob( $dir . '*', GLOB_MARK );
foreach( $files as $file ){
if( substr( $file, -1 ) == '/' )
delTree( $file );
else
unlink( $file );
}
rmdir( $dir );
}
delTree("upload/".$file1."/");

Tagged in:

1279
like
0
dislike
0
mail
flag

You must LOGIN to add comments