1. Go to this page and download the library: Download componenta/byte library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
componenta / byte example snippets
use Componenta\Stdlib\Byte;
$size = Byte::mb(1.5);
(string) $size; // "1.5 MB"
$size->toBits(); // 12582912.0
$size->to('kB', 2); // formatted string
$size->getValue('MB'); // numeric value in megabytes