1
I have a comeback JSON
, but I’m not getting a foreach
(PHP) in it, keeps giving this error:
Invalid argument supplied for foreach()
Follows below the JSON
:
{
"categorias": {
"categoria": [
{
"id": "1",
"nome": "Chás e Ervas",
"subcategorias": [
{
"id": "1",
"nome": "Chás",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
},
{
"id": "2",
"nome": "Chimarrão",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
}
]
},
{
"id": "2",
"nome": "Condimentos e Especiarias",
"subcategorias": [
{
"id": "3",
"nome": "Azeites",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
},
{
"id": "4",
"nome": "Caldos",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
},
{
"id": "5",
"nome": "Conservas",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
}
]
},
{
"id": "3",
"nome": "Diet e Light",
"subcategorias": [
{
"id": "6",
"nome": "Açaí e Guaraná",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
},
{
"id": "7",
"nome": "Adoçantes",
"descricao": "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
}
]
}
]
}
}
This is JSON, right? And your PHP code, you can post it?
– Woss