<?php
function dir_size( $dir )
{
{
while( ( $file = readdir( $handle ) ) !== false ) {
if( substr( $file, 0, 1 ) != '.' ) {
if( is_dir( $dir.'/'.$file ) ) {
$size += dir_size( $dir.'/'.$file.'/' );
}
else
{
}
}
}
}
return $size;
}
function f_size( $rozm )
{
$sizes = array( 'B', 'kB', 'MB', 'GB', 'TB' ); $pos = 0;
while( $rozm >= 1024 )
{
$rozm /= 1024;
$pos++;
}
return round( $rozm, 2
).$sizes[ $pos ]; }
echo f_size
( dir_size
( 'C:/Katalog/' ) ); ?>