PHP code example of koesie10 / unit-converter

1. Go to this page and download the library: Download koesie10/unit-converter 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/ */

    

koesie10 / unit-converter example snippets


$converter = new \Vlaswinkel\UnitConverter\UnitConverter();

echo $converter->convert('1', 'm/s', 'km/h'); // prints 3.6, as expected

$converter = new \Vlaswinkel\UnitConverter\UnitConverter(null, new \Vlaswinkel\UnitConverter\Math\DefaultMathWrapper());