This is my code , how can I achieve it plz help
<?php
$json = '
{
"type": "donut",
"name": "Cake",
"toppings": [{"data":
{ "id": "5002", "type": "Glazed" },
{ "id": "5006", "type": "Chocolate with Sprinkles" },
{ "id": "5004", "type": "Maple" }
}]
}';
$yummy = json_decode($json);
echo $yummy->toppings[0]->data[2]->id;