我的json文件有点问题,我想要做的是从我的json文件中获取特定对象,因此在此json上面添加此参数时stream_id =例如,我添加了这个ID stream_id = 200它应该只显示该对象的ID,所以要更清楚它应该显示ID:200,名称:Ravi Tamada,电子邮件:[email protected]等等,用PHP,谢谢从特定Id获取特定对象JSON
{
"contacts": [
{
"id": "200",
"name": "Ravi Tamada",
"email": "[email protected]",
"address": "xx-xx-xxxx,x - street, x - country",
"gender" : "male",
"url": "http://149.202.196.143:8000/live/djemal/djemal/592.ts"
},
{
"id": "201",
"name": "Johnny Depp",
"email": "[email protected]",
"address": "xx-xx-xxxx,x - street, x - country",
"gender" : "male",
"url":"http://149.202.196.143:8000/live/djemal/djemal/592.ts"
},
{
"id": "202",
"name": "Leonardo Dicaprio",
"email": "[email protected]",
"address": "xx-xx-xxxx,x - street, x - country",
"gender" : "male",
"url":"http://149.202.196.143:8000/live/djemal/djemal/592.ts"
}
]
}
@yBrodsky你能解释一下我的代码,请,这是我的JSON所以在PHP中如何做到这一点 –
检查[json_decode()](http://php.net/manual/en/function.json -decode.php) –