</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/11922383/how-can-i-access-and-process-nested-objects-arrays-or-json" dir="ltr">How can I access and process nested objects, arrays or JSON?</a>
<span class="question-originals-answer-count">
(25 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2016-05-10 15:00:38Z" class="relativetime">3 years ago</span>.</div>
</div>
</aside>
i have created a dynamic array and then, i convert it to json object. The code is the follows:
$array_D1[]="";
$array_D2[]="";
$array_to_send[]="";
$array_D1[$CapaEnviar][] = $fila['test_name'];
$array_D2[]=$seleccio_content;
$array_D2[]=$id_capa;
$array_D2[]=$pagina;
$array_D2[]=$idtest;
$array_D2[]=$valor_org;
$array_D2[]=$valor_eval;
$array_D2[]=$valor_test;
$array_to_send=array('data1' => $array_D1, 'data2' => $array_D2);
echo json_encode($array_to_send,true);
This code is a AJAX response for an AJAX request. I don't know how i can access JSON data from jquery.
i need to acces the values from "data1" and "data2"
</div>