I have a $xml
looks like this
SimpleXMLElement Object
(
[@attributes] => Array
(
[Total] => 450
[Count] => 4
[Start] => 0
)
[Code] => 0
[Item] => Array
(
[0] => SimpleXMLElement Object
(
[Person.P_Id] => 14845
)
[1] => SimpleXMLElement Object
(
[Person.P_Id] => 14844
)
[2] => SimpleXMLElement Object
(
[Person.P_Id] => 14837
)
[3] => SimpleXMLElement Object
(
[Person.P_Id] => 14836
)
)
)
Now I want to get the array Item
to merge with another array, but when I try $xml->Item
, I only get the first element of this array (which is 14845
). When I use count($xml->Item)
, it returns the true value (which is 4). Did I do something wrong to get the whole array Item
?