public static function getHumanSize($size, $precision = 1)
    {
        $units = array(" bytes", "K", "M", "G", "T", "P", "E", "Z", "Y");
        $pow = 1024;
        $factor = 0;

        while ($size + 1 > $pow) {
            $size /= $pow;
            $factor++;
        }

        return round($size, $precision) . $units[$factor];
    }