public function formatFilesize($bytes)
    {
        $units = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');
        $level = floor(log($bytes)/log(1024));

        $output = sprintf('%.2f %s', ($bytes/pow(1024, floor($level))), $units[$level]);

        return $output;
    }
public function formatFilesize($bytes)
    {
        $units = array('bytes', 'kb', 'MB', 'GB', 'TB', 'PB');
        $level = floor(log($bytes)/log(1024));

        $output = sprintf('%.2f %s', ($bytes/pow(1024, floor($level))), $units[$level]);

        return $output;
    }
public function formatFilesize ( $ bytes ) { $ units = array ( 'bytes' , 'kb' , 'MB' , 'GB' , 'TB' , 'PB' ) ; $ level = floor ( log ( $ bytes ) / log ( 1024 ) ) ; $ output = sprintf ( '%.2f %s' , ( $ bytes / pow ( 1024 , floor ( $ level ) ) ) , $ units [ $ level ] ) ; return $ output ; }
Format byte filesize to human readable filesize

@param  integer $bytes
@return string
Format byte filesize to human readable filesize