This is a php plugin that lets you convert filesizes. I'm not sure why would anyone need this, but here it is!
You can install the package via composer:
composer require xndbogdan/filesize-conversions
FilesizeConversions::fromBytes(pow(1024, 5))->toPetabytes();
You can also use this package to get a real file's size and convert it to anything, like this:
FilesizeConversions::fromFile($yourFilePath)->toKilobytesHuman();
Moreover, you can now do quick conversions
FileSizeConversions::quickConvert('megabytes', 'kilobytes', 15);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.