I have this json encoded string
{"allresponses":"{\"id\":\"123456\",\"recipients\":1}"}
and I have to get the id only and pass it to a php variable.
This is what I'm trying: suppose I have that string in variable return, so:
$return = '{"allresponses":"{\"id\":\"123456\",\"recipients\":1}"}';
$getid = json_decode($return,true);
echo $getid[0]['id'];
This is not working; I get fatal error. Can you tell me why? What's wrong?