Hello, I have this code:
<?php $url = 'https://api.privatbank.ua/p24api/pubinfo?json&exchange&coursid=5'; $obj = json_decode(file_get_contents($url), true); print_r($obj); ?> he receives data from PrivatBank in the following form:
Array ( [0] => Array ( [ccy] => USD [base_ccy] => UAH [buy] => 26.50000 [sale] => 26.85000 ) [1] => Array ( [ccy] => EUR [base_ccy] => UAH [buy] => 32.20000 [sale] => 32.70000 ) [2] => Array ( [ccy] => RUR [base_ccy] => UAH [buy] => 0.46000 [sale] => 0.49000 ) [3] => Array ( [ccy] => BTC [base_ccy] => USD [buy] => 10136.3718 [sale] => 11203.3583 ) ) I need from this in 2 variables to get the dollar to hryvnia exchange rate, that is, Chila: 26,50000 and 26.85000, so that I would end up with 2 variables $ kurs_buy $ kurs_sale. The whole brain continued, but how to get these values from there I can not understand