PHP code example of scera-api / php-client

1. Go to this page and download the library: Download scera-api/php-client 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/ */

    

scera-api / php-client example snippets


composer 



use SceraApi\PhpClient\Client;

$client = new Client($token);
try {
    $result = $client->convert('USD', 'EUR', 100.0);
} catch (Throwable $t) {
    //Manage the error
}

$rate   = $result->getRate();       //Example: 0.94525
$result = $result->getResult();     //Example: 94.525