Answer the question
In order to leave comments, you need to log in
api pb xml parser
Faced this problem:
$url = 'https://api.privatbank.ua/p24api/pubinfo?exchange&coursid=5';
$content = simplexml_load_file($url);
echo '<pre>';
print_r($content->row[0]);
SimpleXMLElement Object
(
[0] => SimpleXMLElement Object
(
[@attributes] => Array
(
[ccy] => RUR
[base_ccy] => UAH
[buy] => 0.24900
[sale] => 0.25500
)
)
)
Answer the question
In order to leave comments, you need to log in
$url = 'https://api.privatbank.ua/p24api/pubinfo?exchange&coursid=5';
$content = simplexml_load_file($url);
echo '<pre>';
print_r($content->row[0]['ccy']);
print_r($content->row[0]->ccy);
print_r($content->row[0]->attributes());
print_r($content->row->attributes());
print_r($content->row->attributes('ccy'));
SimpleXMLElement Object
(
)
SimpleXMLElement Object
(
)
SimpleXMLElement Object
(
)
SimpleXMLElement Object
(
)
Happened by accident somehow$content->row[0]->exchangerate->attributes()->ccy
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question