I have this object:
stdClass Object (
[0] => stdClass Object (
[type] => A
[quantity] => 30
)
[1] => stdClass Object (
[type] => P
[quantity] => 129
)
)
However, I cannot access the sub-objects (e.g., $Data->0->quantity
) because numeric properties of objects are not accessible in PHP.
How can I access the sub-objects without resorting to looping?