📜  php 返回 json 数据 - PHP 代码示例

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

代码示例3
$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);