fileSize

function fileSize($bytes, $decimals = 2, $separator = ',')
{
    $size   = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
    $factor = floor((strlen($bytes) - 1) / 3);

    return str_replace(
        '.',
        $separator,
        sprintf(
            "%.{$decimals}f",
            $bytes / pow(1024, $factor)
        ) . ' ' . @$size[$factor]
    );
}