class Filesize

internal  
 

Methods

static string
toHuman(int $bytes, int $decimals = 2)

Convert bytes to human-readable format.

Details

at line 20
static string toHuman(int $bytes, int $decimals = 2)

Convert bytes to human-readable format.

Credit: https://stackoverflow.com/a/23888858/1580028

Parameters

int $bytes

the amount of bytes to convert to human-readable format

int $decimals

the number of decimals to use in the resulting string

Return Value

string