|
|
|
| Есть xml файл, после вывода через var_dump($xml); он выглядит так:
object(SimpleXMLElement)#1 (1) {
["rows"]=>
object(SimpleXMLElement)#2 (2) {
["@attributes"]=>
array(1) {
["cnt"]=>
string(2) "20"
}
["row"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#3 (5) {
["@attributes"]=>
array(1) {
["id"]=>
string(1) "1"
}
["id_goods"]=>
string(6) "163001"
["place"]=>
string(46) "Магазин цифровых товаров"
["server"]=>
string(32) "http://www.адрес.сайта"
["price"]=>
string(3) "0,6"
}
[1]=>
object(SimpleXMLElement)#4 (5) {
["@attributes"]=>
array(1) {
["id"]=>
string(1) "2"
}
["id_goods"]=>
string(6) "368362"
["place"]=>
string(39) "Букмекерская контора"
["server"]=>
string(32) "http://www.адрес.сайта"
["price"]=>
string(4) "0,12"
}
}
}
}
|
Как достать атрибут cnt, нужна цифра 20 для php | |
|
|