Hallo,
[link:http://de3.php.net/manual/de/language.functions.php@title=function] dir_size($d='./'){
$size=array('file'=>0,'dir'=>0);
$d=([link:http://de3.php.net/manual/de/function.substr.php@title=substr]($d,-1)=='/') ? $d : $d.'/';
[link:http://de3.php.net/manual/de/function.clearstatcache.php@title=clearstatcache]();
[link:http://de3.php.net/manual/de/language.control-structures.php#control-structures.if@title=if]($dir=@[link:http://de3.php.net/manual/de/function.opendir.php@title=opendir]($d)){
[link:http://de3.php.net/manual/de/control-structures.while.php@title=while](($f=[link:http://de3.php.net/manual/de/function.readdir.php@title=readdir]($dir))!==FALSE)
if([link:http://de3.php.net/manual/de/function.filetype.php@title=filetype]($d.$f)!='dir')
$size['file']++;
[link:http://de3.php.net/manual/de/control-structures.elseif.php@title=elseif](![link:http://de3.php.net/manual/de/function.in-array.php@title=in_array]($f,array('.','..'))){
$size['dir']++;
$t=dir_size($d.$f.'/');
$size['dir']+=$t['dir'];
$size['file']+=$t['file'];
}
[link:http://de3.php.net/manual/de/function.closedir.php@title=closedir]($dir);
}
else [link:http://de3.php.net/manual/de/function.return.php@title=return]('Fehler bei '.$d);
return($size);
}
ein silbernes Tablett, hast Du selbst?
Gruß aus Berlin!
eddi