Skip to content

Kirby 5.5.0

Str::toBytes()

Converts a filesize string with shortcuts like M, G or K to an integer value. Fractional sizes are supported (e.g. 1.5G returns 1.5 GiB).

Str::toBytes(string $size): int

Parameters

Name Type Default
$sizerequired string no default value

Return type

int

Parent class

Kirby\Toolkit\Str