这是我的json如何获得“下载”字符串
{
"total": 1,
"items": [
{
"id": "1186e1472bc1c",
"title": "title,
"desc": "",
"download": "www.google.com",
}
]
}
这是我的代码:
$response = file_get_contents($nagu);
$obj = json_decode($response, true);
$download = $obj ['items'];
echo $download;
我想要输出“www.google.com”。
答案 0 :(得分:4)
$download = $obj ['items'][0]['download'];
echo $download;