Return to Snippet

Revision: 4728
at January 18, 2008 02:23 by DeadLy


Initial Code
function file_size($size)
{
    $filesizename = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
    return $size ? round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 Bytes';
}

Initial URL

                                

Initial Description

                                

Initial Title
Convert size in *KB, *MB, *GB ....

Initial Tags
convert

Initial Language
PHP