1
$dados= '{"nome":"teste","cpf":"teste"}';
$value = json_decode($dados, TRUE);
foreach($value as $in)
{
$nome = $in->{'nome'};
$cpf = $in->{'cpf'};
}
i am trying to get the data, but the name value and Cpf comes null!!!
1
$dados= '{"nome":"teste","cpf":"teste"}';
$value = json_decode($dados, TRUE);
foreach($value as $in)
{
$nome = $in->{'nome'};
$cpf = $in->{'cpf'};
}
i am trying to get the data, but the name value and Cpf comes null!!!
2
Try it this way:
$dados= '[{"nome":"teste","cpf":"teste"}]';
$value= json_decode($dados, TRUE);
foreach($vaue as $in)
{
$nome = $in['nome'];
$cpf $in['cpf'];
}
that’s right, thank you!
@By following, mark as the right answer to help others who have the same question.
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
This is not a multidimencional array
– Diego Ananias