Get Value ID use json php


#1

hi, how to get value id on json php?
my array
{“result”:{“id”:“9a7329647xxxx31e6dd2bc2b”,“type”:“A”,“name”:“domss.xxxs.com”,“content”:“192.168.100.1”,“proxiable”:false,“proxied”:false,“ttl”:1,“priority”:10,“locked”:false,“zone_id”:“eb0d86xxxx51d4a734bfd69f837c”,“zone_name”:“mexious.com”,“modified_on”:“2018-07-06T10:38:37.469331Z”,“created_on”:“2018-07-06T10:38:37.469331Z”,“meta”:{“auto_added”:false,“managed_by_apps”:false,“managed_by_argo_tunnel”:false}},“success”:true,“errors”:[],“messages”:[]}


#2

Hello,
You can use json_decode.

$jsonarray = curl_exec($ch);
$newarray = json_decode(trim($jsonarray), TRUE);
print_r($newarray); 
// for just echo id
echo $newarray["result"]["id"]
// if key exist
echo $newarray["result"]["keyid"]["id"]