php 循环输出 json 数组

{"code":1,"msg":"\u67e5\u8be2\u8ba2\u5355\u8bb0\u5f55\u6210\u529f\uff01","data":[{"tr... {"code":1,"msg":"\u67e5\u8be2\u8ba2\u5355\u8bb0\u5f55\u6210\u529f\uff01","data":[{"trade_no":"2018011721515397116","0":"2018011721515397116","out_trade_no":"2018011755100515","1":"2018011755100515","notify_url":"http:\/\/localhost:33\/req\/pay\/notify_url.php","2":"http:\/\/localhost:33\/req\/pay\/notify_url.php","return_url":"http:\/\/localhost:33\/req\/pay\/return_url.php","3":"http:\/\/localhost:33\/req\/pay\/return_url.php","type":"alipay","4":"alipay","buyer":"","5":"","pid":"1177","6":"1177","addtime":"2018-01-17 21:51:53","7":"2018-01-17 21:51:53","endtime":"2018-01-17 21:52:12","8":"2018-01-17 21:52:12","name":"\u6d4b\u8bd5","9":"\u6d4b\u8bd5","money":"0.01","10":"0.01","status":"1","11":"1","domain":"localhost","12":"localhost","ip":"116.20.26.77","13":"116.20.26.77"},{"trade_no":"2018011721155484691","0":"2018011721155484691","out_trade_no":"2018011799555251","1":"2018011799555251","notify_url":"http:\/\/\/req\/pay\/notify_url.php","2":"http:\/\/\/req\/pay\/notify_url.php","return_url":"http:\/\/\/req\/pay\/return_url.php","3":"http:\/\/\/req\/pay\/return_url.php","type":"alipay","4":"alipay","buyer":"","5":"","pid":"1177","6":"1177","addtime":"2018-01-17 21:15:54","7":"2018-01-17 21:15:54","endtime":"2018-01-17 21:16:25","8":"2018-01-17 21:16:25","name":"\u6d4b\u8bd5","9":"\u6d4b\u8bd5","money":"0.01","10":"0.01","status":"1","11":"1","domain":"","12":"","ip":"116.20.26.77","13":"116.20.26.77"}]}
这样子的数据

如何用php 循环把他们输出来?
展开
 我来答
藤原子大雄
2018-01-18 · TA获得超过7197个赞
知道大有可为答主
回答量:6977
采纳率:82%
帮助的人:1772万
展开全部
<?php
$Tdata='[{"A_Name":"a1","ICNo":"","A_ContNo":"","A_QQNo":""},{"A_Name":"a2","ICNo":"","A_ContNo":"","A_QQNo":""},{"A_Name":"a3","ICNo":"","A_ContNo":"","A_QQNo":""}]';

$arr=json_decode($Tdata,true);
//var_dump($arr);
echo stripcslashes ($arr[0][A_Name]);
?>
上面的方法可以打印输出,json_decode($Tdata)输出的结果是一个对应,而json_decode($Tdata,true)输出的是一个数组
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式