У меня есть этот объект SimpleXMLElement.
[prices] => SimpleXMLElement Object
(
[price] => Array
(
[0] => SimpleXMLElement Object
(
[term] => 0.5
[price] => 35
[currency] => EUR
)
[1] => SimpleXMLElement Object
(
[term] => 1
[price] => 60
[currency] => EUR
)
[2] => SimpleXMLElement Object
(
[term] => 2
[price] => 50
[currency] => EUR
)
)
)
)
Попытка создать $term[]
массив ...
foreach($xmlData->prices->price as $term) {
$term[] = array(
'term' => (string)$term->term,
'price' => (string)$term->price,
'currency' => (string)$term->currency
);
}
Но получая ПРЕДУПРЕЖДЕНИЕ: пока нельзя назначить сложные типы свойств в этой строке: $term[] = array(
Как решить эту проблему?
РЕШЕНО путем изменения $term[] = array(
на $terms[] = array(