I'm with the code:
<?php
$d = json_decode($output);
?>
The $ output variable sends jSON data to PHP. For you to understand this variable better, I will post the return of it
object(stdClass)#1 (6) {
["nome_1"]=>
string(14) "Alisson Acioli"
["cpf_1"]=>
string(11) "XXXXXXXXXX"
["nascimento_1"]=>
string(10) "2014-07-19"
["nome_2"]=>
string(14) "Alisson Acioli"
["cpf_2"]=>
string(11) "XXXXXXXXXX"
["nascimento_2"]=>
string(10) "2014-07-25"
}
What I want to do is loop the data returned. I have display doing
<?php
echo $d['nome_1'];
?>
Only the screen turns white, nothing appears. I actually wish that instead of having _1, _2 all be [name], [cpf] etc ... and I would looping later. The code that generates jSON is as follows
<?php
$SQLResults = mysql_query("SELECT * FROM {$table} WHERE {$verificacao}");
$i = 0;
while($data=mysql_fetch_array($SQLResults)){
$i++;
foreach($this->dados["dados"]["show"] as $val){
$Resultados[$val.'_'.$i] = $data[$val];
}
}
echo json_encode($Resultados);
?>