OMGM Code
Status: Beta
Brought to you by:
ifkkiruna
--- a +++ b/omgm/deletetiles.php @@ -0,0 +1,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>