php获取并输出 json数组里面的值 10
json值如下请问怎样才能用PHP输出里面的所有日期{"header":{"desc":"success","failures":[],"oprs":1,"succ":1...
json值如下
请问怎样才能用PHP输出里面的所有日期
{"header":{"desc":"success","failures":[],"oprs":1,"succ":1,"oprtime":0,"quota":1,"rquota":1970,"status":0},"body":{"data":[{"result":{"total":8,"items":[[["2017/10/20"],["2017/10/19"],["2017/10/18"],["2017/10/17"],["2017/10/16"],["2017/10/15"],["2017/10/14"],["2017/10/13"]],[[5],[207],[185],[93],[139],[111],[146],[219]],[],[]],"timeSpan":["2017/10/13 - 2017/10/20"],"sum":[[1105],[]],"offset":0,"pageSum":[[1105],[],[]],"fields":["simple_date_title","pv_count"]}}]}} 展开
请问怎样才能用PHP输出里面的所有日期
{"header":{"desc":"success","failures":[],"oprs":1,"succ":1,"oprtime":0,"quota":1,"rquota":1970,"status":0},"body":{"data":[{"result":{"total":8,"items":[[["2017/10/20"],["2017/10/19"],["2017/10/18"],["2017/10/17"],["2017/10/16"],["2017/10/15"],["2017/10/14"],["2017/10/13"]],[[5],[207],[185],[93],[139],[111],[146],[219]],[],[]],"timeSpan":["2017/10/13 - 2017/10/20"],"sum":[[1105],[]],"offset":0,"pageSum":[[1105],[],[]],"fields":["simple_date_title","pv_count"]}}]}} 展开
1个回答
展开全部
$json = '{"header":{"desc":"success","failures":[],"oprs":1,"succ":1,"oprtime":0,"quota":1,"rquota":1970,"status":0},"body":{"data":[{"result":{"total":8,"items":[[["2017/10/20"],["2017/10/19"],["2017/10/18"],["2017/10/17"],["2017/10/16"],["2017/10/15"],["2017/10/14"],["2017/10/13"]],[[5],[207],[185],[93],[139],[111],[146],[219]],[],[]],"timeSpan":["2017/10/13 - 2017/10/20"],"sum":[[1105],[]],"offset":0,"pageSum":[[1105],[],[]],"fields":["simple_date_title","pv_count"]}}]}}';
$arr = json_decode($json,true);
echo 'desc值:'. $arr['header']['desc'];
$arr = json_decode($json,true);
echo 'desc值:'. $arr['header']['desc'];
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询