PHP code example of minhyung / trif-fxrt

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

    

minhyung / trif-fxrt example snippets


use Minhyung\TrifFxrt\TrifFxrt;

$serviceKey = '발급받은 서비스키';
$client = new TrifFxrt($serviceKey);

// 환율정보 조회
$result = $client->getRetrieveTrifFxrtInfo('20240118', 1); // 1: 수출, 2: 수입

if ($result->isSuccessful()) {
	foreach ($result as $item) {
		// $item['aplyBgnDt'], $item['cntySgn'], $item['currSgn'], $item['fxrt'], ...
	}
} else {
	echo $result->resultMsg;
}