I have a question about some JSON and PHP, see json below. How can I get the number string?
{
”data”: [
{
”numbers”: [
{
”number”: "XXXX",
”type”: ””
}
]
}
]
}
Ive tried with the following but its not working: $item['numbers'][0]->number;
Note, the $item array is ok. I just do not know what is wrong here.
EDIT:
I should point out that there was an json_decode before. So the structure looks like this:
Array
(
[0] => Array
(
[number] => XXXX
[type] =>
)
)
print_r($item['numbers']);
This doesn't work: $item['numbers'][0]['number']; Error: Undefined offset: 0 in
Thanks!