S
S
Shuhratjon Djumaev2016-06-18 09:18:35
PHP
Shuhratjon Djumaev, 2016-06-18 09:18:35

Why can't get xml object from php link?

My script

$xml = simplexml_load_file('http://www.nbt.tj/ru/kurs/export_xml.php?date=2016-06-18&export=xmlout');
print_r($xml);

Outputs nothing, but the link itself in the browser outputs data.
How do I get this xml object?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
utyfua, 2016-06-18
@utyfua

start by checking:

echo file_get_contents('http://www.nbt.tj/ru/kurs/export_xml.php?date=2016-06-18&export=xmlout')
because it is possible that the ip is blocked.
Then read how to work with xml. if I'm not mistaken, then in php there is a built-in xml "encoder" and "decoder"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question