【发布时间】:2017-07-03 03:38:15
【问题描述】:
我的 json 文件有点问题,我想做的是从我的 json 文件中获取特定对象,所以在上面的这个 json 中,当我添加这个参数 stream_id= 和例如我添加了这个 id stream_id=200 它应该只显示具有该 id 的对象,所以更清楚地说它应该显示 id:200, name:Ravi Tamada, email:ravi@gmail .com 等,用 PHP,谢谢
{
"contacts": [
{
"id": "200",
"name": "Ravi Tamada",
"email": "ravi@gmail.com",
"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": "johnny_depp@gmail.com",
"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": "leonardo_dicaprio@gmail.com",
"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 中怎么做