答案 0 :(得分:1)
$json = '{
"status": "success",
"id": "https://api.test.com/me",
"denormalized": {
"https://api.test.com/me": {
"data": {
"user": {
"id2": "https://api.test.com/users/20"
},
"sauce": "sadasdksdls",
"session_id": "opoqwrpoqirpoewripwor"
},
"relations": {
"profile": "https://api.test.com/users/20",
"quick_chat_profile": "https://api.test.com/profile/20"
},
"updates": null
}
}
}';
$array = json_decode($json, true);
$id2_data = file_get_contents($a['denormalized']['https://api.test.com/me']['data']['user']['id2']);
步骤1:将返回的json分配给变量$ json
第2步:将json转换为php数组
第3步:将id2作为$ a [&#39;非规范化&#39;] [&#39;数据&#39;] [&#39;用户&#39;] [&#39; id2&#39;] < / p>