📜  如何在php代码示例中从json中提取数据

📅  最后修改于: 2022-03-11 14:54:23.705000             🧑  作者: Mango

代码示例5
$json = '
{
    "type": "donut",
    "name": "Cake",
    "toppings": [
        { "id": "5002", "type": "Glazed" },
        { "id": "5006", "type": "Chocolate with Sprinkles" },
        { "id": "5004", "type": "Maple" }
    ]
}';

$yummy = json_decode($json);

print_r($yummy);