public function humanFileSize($file)
    {
        $size = filesize($file);
        $mod = 1024;
        $units = explode(' ', 'B KB MB GB TB PB');
        for ($i = 0; $size > $mod; ++$i) {
            $size /= $mod;
        }

        return round($size, 2).' '.$units[$i];
    }
public function humanFileSize($file)
    {
        $size = filesize($file);
        $mod = 1024;
        $units = explode(' ', 'B KB MB GB TB PB');
        for ($i = 0; $size > $mod; ++$i) {
            $size /= $mod;
        }

        return round($size, 2).' '.$units[$i];
    }
public function humanFileSize ( $ file ) { $ size = filesize ( $ file ) ; $ mod = 1024 ; $ units = explode ( ' ' , 'B KB MB GB TB PB' ) ; for ( $ i = 0 ; $ size > $ mod ; ++ $ i ) { $ size /= $ mod ; } return round ( $ size , 2 ) . ' ' . $ units [ $ i ] ; }
Get a human file size.

@param string $file The file path

@return string The human size
Get a human file size .