我有 JSON 数据,如图所示:
{
"15": {
"nid": "15",
"status": "1",
"created": "1352652530",
"changed": "1353780901",
"title": "some data",
"type": "some data",
"tracking_url": {
"10": {
"affiliate": "OMG",
"url_part1": "some data"
}
},
"primary_category": "Travel",
"active_affiliate": "OMG"
},
"16": {
"nid": "16",
"status": "1",
"created": "1352652530",
"changed": "1353780901",
"title": "some data",
"type": "some data",
"tracking_url": {
"11": {
"affiliate": "OMG",
"url_part1": "some data"
}
},
"primary_category": "Travel",
"active_affiliate": "OMG"
}
}
我可以使用以下方法成功解码 JSON:
$response = json_decode($p, true);
现在我必须从(在tracking_url中提取元素)中提取url_part1和附属值,这是我无法做到的。$response