class Bytes (View source)

Provides helper methods for byte conversions.

Constants

KILOBYTE

The number of bytes in a kilobyte.

Methods

static int
toInt(mixed $size)

Parses a given byte size.

Details

static int toInt(mixed $size)

Parses a given byte size.

Parameters

mixed $size

An integer or string size expressed as a number of bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).

Return Value

int

An integer representation of the size in bytes.