PHP code example of mahounou / uconv

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

    

mahounou / uconv example snippets



Uconv\Uconv;

echo Uconv::convert("10km", "m");      // 10000
echo Uconv::convert("5lbs", "kg");     // 2.26796
echo Uconv::convert("1hr", "min");     // 60
echo Uconv::convert("100USD", "EUR");  // ~85

use Uconv\Counter;

Counter::increment("server.request");      // 1
Counter::increment("server.request");      // 2
Counter::increment("loop.iteration");      // 1

echo Counter::get("server.request");       // 2
print_r(Counter::all());                   // ["server.request" => 2, "loop.iteration" => 1]

Uconv::resetRequestCount();
Uconv::convert("10km", "m");

echo Uconv::getRequestCount();             // 1