PHP code example of gecleanme / xkunverio

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

    

gecleanme / xkunverio example snippets



// use the designated Conversion Type Class & its corresponding Enum following the naming pattern :
//"X{ConversionType}" & "X{ConversionType}Unit" for the Enum

use gecleanme\Xkunverio\Enums\XLengthUnit;
use gecleanme\Xkunverio\XLength;

// Invoke the 'convert' method with the "unit from", "unit to" and the measurement value then call
// get()

// Convert one Kilometer to Meters
XLength::convert(XLengthUnit::Kilometer, XLengthUnit::Meter, 1)
    ->get(); //1000.0