php怎么接收json类型数据?
{"sign":true,"message":"实时接口","data":[{"title":"北京快3","name":"bjk3","expect":"145130"...
{"sign":true,"message":"实时接口","data":[{"title":"北京快3","name":"bjk3","expect":"145130","opencode":"4,5,6","opentime":"2019-11-21 20:22:45","source":"sourcecode":""}]}
需要145130 4,5,6 2019-11-21 20:22:45数据 展开
需要145130 4,5,6 2019-11-21 20:22:45数据 展开
3个回答
展开全部
<?php
$str='{"sign":true,"message":"实时接口","data":[{"title":"北京快3","name":"bjk3","expect":"145130","opencode":"4,5,6","opentime":"2019-11-21 20:22:45","source":"sourcecode":""}]}';
$json=json_decode($str,false);
echo $json['data'][0]['expect'];
echo $json['data'][0]['opencode'];
echo $json['data'][0]['opentime'];
?>
$str='{"sign":true,"message":"实时接口","data":[{"title":"北京快3","name":"bjk3","expect":"145130","opencode":"4,5,6","opentime":"2019-11-21 20:22:45","source":"sourcecode":""}]}';
$json=json_decode($str,false);
echo $json['data'][0]['expect'];
echo $json['data'][0]['opencode'];
echo $json['data'][0]['opentime'];
?>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
$data='{"sign":true,"message":"实时接口","data":[{"title":"北京快3","name":"bjk3","expect":"145130","opencode":"4,5,6","opentime":"2019-11-21 20:22:45","source":"","sourcecode":""}]}';
$result=json_decode($data,true);
echo $result['data'][0]['expect']; echo " ";echo " ";
echo $result['data'][0]['opencode'];echo " ";echo " ";
echo $result['data'][0]['opentime'];
$result=json_decode($data,true);
echo $result['data'][0]['expect']; echo " ";echo " ";
echo $result['data'][0]['opencode'];echo " ";echo " ";
echo $result['data'][0]['opentime'];
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
如果是post请求$_POST[‘key值’]
如果是get请求$_GET[‘key
值’]
如果是get请求$_GET[‘key
值’]
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询