Новичок

Покинул форум
Сообщений всего: 5
Дата рег-ции: Февр. 2014
Помог: 0 раз(а)

|
Вот текст xml файла catalog.xml
CODE ( htmlphp):
скопировать код в буфер обмена
<?xml version="1.0"?> <catalog version="1.0" date="2016-06-03 03:20"><shop> <name>111111111111</name> <currencies> <currency id="RUR" rate="1" /> <currency id="USD" rate="42" /> <currency id="EUR" rate="53" /> </currencies> </shop></catalog>
Вот код php файла
Выводит пустое окно.
print_r($xml); выводит вот что:
SimpleXMLElement Object ( [@attributes] => Array ( [version] => 1.0 [date] => 2016-06-03 03:20 ) [shop] => SimpleXMLElement Object ( [name] => 111111111111 [currencies] => SimpleXMLElement Object ( [currency] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => RUR [rate] => 1 ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => USD [rate] => 42 ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [id] => EUR [rate] => 53 ) ) ) ) ) )
Не пойму, как мне вывести например все значения в теге currencies хмл файла?
|