protected function getFileSize($size)
    {
        $units = array('Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
        return round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$units[$i];
    }
protected function getFileSize($size)
    {
        $units = array('Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB');
        return round($size / pow(1024, ($i = floor(log($size, 1024)))), 2).' '.$units[$i];
    }
protected function getFileSize ( $ size ) { $ units = array ( 'Bytes' , 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' ) ; return round ( $ size / pow ( 1024 , ( $ i = floor ( log ( $ size , 1024 ) ) ) ) , 2 ) . ' ' . $ units [ $ i ] ; }
Calculate the human-readable file size with units.

@param  int     $size
@return string
Calculate the human - readable file size with units .