Download the PHP package elephant-php/byte-size without Composer
On this page you can find all versions of the php package elephant-php/byte-size. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download elephant-php/byte-size
More information about elephant-php/byte-size
Files in elephant-php/byte-size
Download elephant-php/byte-size
More information about elephant-php/byte-size
Files in elephant-php/byte-size
Vendor elephant-php
Package byte-size
Short Description ByteSize uses binary conversion (1024-based) for file-size formatting.
License MIT
Package byte-size
Short Description ByteSize uses binary conversion (1024-based) for file-size formatting.
License MIT
Please rate this library. Is it a good library?
Informations about the package byte-size
ByteSize
A small value object for working with file sizes in a clean and predictable way.
It uses 1024 based conversion and gives you a simple API to:
- create sizes from bytes, KB, MB, GB, or TB
- convert values between units
- format values for UI or CLI output
- generate human-readable file size strings
Installation
Requirements
- PHP
8.1or higher
Quick example
Real-world example
Creation
Short aliases are available too:
Conversion
Short aliases:
Formatting
Use format() when you want an explicit unit.
$precisioncontrols the number of decimal places before trailing zeros are trimmed$labeloverrides the default unit label- passing
''as label returns only the numeric value
Human-readable output
Use human() when you want ByteSize to choose the most suitable unit automatically.
Examples:
Available units
License
MIT License
Please see LICENSE for more information.
All versions of byte-size with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package elephant-php/byte-size contains the following files
Loading the files please wait ...