I have the following Json in a PHP variable:
[
{"pergunta[0]":"Quantos anos?"},
{"pergunta[1]":"Qual sua altura?"},
{"resposta[0]":"12"},
{"resposta[1]":"1.65"}
]
and my goal is to show it as follows:
How many years? 12.
How tall are you? 1.65.
I've tried it this way:
$obj = json_decode([{"pergunta[0]":"Quantos anos?"},{"pergunta[1]":"Qual sua altura?"},{"resposta[0]":"12"},{"resposta[1]":"1.65"}]);
echo $obj['pergunta'];
Any suggestions?