pharaonic / php-readable
Framework-agnostic, human-friendly formatting for PHP: numbers, bytes, money, durations, plus small array and string inspection helpers.
8.5.2
2026-10-11 09:32 UTC
Requires
- php: >=8.5 <8.6
- ext-mbstring: *
Requires (Dev)
- laravel/pint: ^1.20
- pestphp/pest: ^4.0
- phpstan/phpstan: ^2.1.33
Suggests
- ext-intl: Required only when passing a $locale to the Number, Money and Bytes formatters.
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 8.5.x-dev
- 8.5.2
- 8.5.1
- 8.5.0
- 8.4.x-dev
- 8.4.2
- 8.4.1
- 8.4.0
- 8.3.x-dev
- 8.3.2
- 8.3.1
- 8.3.0
- 8.2.x-dev
- 8.2.2
- 8.2.1
- 8.2.0
- 8.1.x-dev
- 8.1.2
- 8.1.1
- 8.1.0
- 8.0.x-dev
- 8.0.3
- 8.0.2
- 8.0.1
- 8.0.0
- dev-fix/input-limits-8.5.x
- dev-fix/input-limits-8.4.x
- dev-fix/input-limits-8.3.x
- dev-fix/input-limits-8.2.x
- dev-fix/input-limits-8.1.x
- dev-fix/input-limits-8.0.x
- dev-docs/readme-8.5.x
- dev-docs/readme-8.4.x
- dev-docs/readme-8.3.x
- dev-docs/readme-8.2.x
- dev-docs/readme-8.1.x
- dev-docs/readme-8.0.x
- dev-migrate/pest-pint-8.2.x
- dev-migrate/pest-pint-8.3.x
- dev-migrate/pest-pint-8.4.x
- dev-migrate/pest-pint-8.5.x
- dev-migrate/pest-pint-8.0.x
- dev-migrate/pest-pint-8.1.x
This package is auto-updated.
Last update: 2026-10-11 10:00:21 UTC
README
Human-friendly numbers, sizes, money and durations for PHP.
Format numbers, byte sizes, money and durations into readable text with predictable output, plus optional Intl locales.
Installation
composer require pharaonic/php-readable
Usage
use Pharaonic\Readable\{Bytes, Duration, Money, Number}; Number::compact(1250000); // "1.3M" Bytes::format(1536, binary: true); // "1.5 KiB" Money::format(1234.5, 'USD'); // "USD 1,234.50" Duration::format(3661); // "1 hour 1 minute 1 second"
Documentation
Full documentation: PHP Readable Documentation.
Support & Security
See SUPPORT.md and SECURITY.md. Contributions are welcome; see CONTRIBUTING.md.
License
MIT. See LICENSE.
