1. Go to this page and download the library: Download soandso/units 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/ */
soandso / units example snippets
use Soandso\Units\Bootstrap;
Bootstrap::init();
use Soandso\Units\Registry\Quantity;
use Soandso\Units\Unit;
$temperature = Quantity::get(Unit::TEMPERATURE);
$temperature->name;
$temperature->description;
$temperature->class;
$temperature->units;
use Soandso\Units\Value\Temperature;
Temperature::c(20)
->toF()
->value(); //68
use Soandso\Units\Value\Temperature;
use Soandso\Units\Enum\Temperature as TemperatureUnit;
Temperature::c(20)
->convertTo(TemperatureUnit::F)
->value(); //68