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
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.
