i have an array in php like this:
$arr['test'] = "asd";
$arr['test1'] = "asd1";
echo json_encode($arr);
and i get this using jquery post:
$.post("fillScheda.php",{scheda:num_scheda,id:idCliente},function(msg){
});
so in msg there is my json array...
i tried to access in some way..
alert(msg[0].test);
alert(msg.test);
but result is always undefined... how can i access to values? can someone help me? thanks!!!
msg.testshould work. Can you double check your server is outputting{"test":"asd","test1":"asd1"}, and nothing more via the network tab in your developer tools?