Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

size_format()

3 tags 1 category

size_format() — Converts a number of bytes to the largest unit the bytes will fit into. It is easier to read 1 KB than 1024 bytes and 1 MB than 1048576 bytes. Converts number of bytes to human readable number by taking the number of that unit that the bytes will go into it. Supports YB value. Please note that integers in PHP are limited to 32 bits, unless they are on 64 bit architecture, then they have 64 bit size. If you need to place the larger size then what PHP integer type will hold, then use a string.

Inputs: $bytes (int|float|string): Number of bytes. Note max integer size for integers. $decimals (int): Optional. Precision of number of decimal places. Default 0.

Returns string|false: Number string on success, false on failure.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…