[go: up one dir, main page]

Menu

[r4]: / omgm / deletetiles.php  Maximize  Restore  History

Download this file

30 lines (25 with data), 602 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<pre>
<?php
deleteFilesInDir("tilesdir/6/");
deleteFilesInDir("tilesdir/7/");
function deleteFilesInDir($dir){
echo "** Delete files in dir ".$dir."<br>";
$files = scandir($dir);
foreach($files as $file){
if( !(strcmp(".", $file) == 0 || strcmp("..", $file) == 0) ){
$path = $dir.$file;
if( is_dir($path) ){
echo "Is dir: ".$path."<br>";
deleteFilesInDir($path."/");
echo "Delete dir: ".$path."<br>";
rmdir($path);
}
else{
echo "Is file: ".$path."<br>";
unlink($path);
}
}
}
}
?>
</pre>