size; $units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; $power = $size > 0 ? floor(log($size, 1024)) : 0; $value = number_format($size / pow(1024, $power), 2, '.', ',').' '.$units[$power]; if ($this->poster == 'ATTACHMENT') { if (mime($this->type) == true) { $var = ''; return '
  • '.$var.'
    '.$this->name.'

    '.$value.'

  • '; } else { //$var = ''; $var = ''.strtoupper($this->type).'
    '.$this->name.'

    '.$value.'

    '; return '
  • '.$var.'
  • '; } } } }