小白请教一下,php怎么用foreach获取TrafficUsed的值
代码如下:
{“TotalCount”:1,”InstanceTrafficPackageSet”:[{“InstanceId”:”123-123″,”TrafficPackageSet”:[{“TrafficPackageId”:”123-1234″,”TrafficUsed”:1103114770439,”TrafficPackageTotal”:1099511627776,”TrafficPackageRemaining”:0,”TrafficOverflow”:3603142663,”StartTime”:”2021-04-24T11:59:42Z”,”EndTime”:”2021-05-24T11:59:41Z”,”Deadline”:”2022-03-24T11:59:43Z”,”Status”:”OVERDUE_NETWORK_DISABLED”}]}],”RequestId”:”1-2-3-4″}
浙江省网友说:不用PHP好久了,python golang 我还可以说两句
安徽省网友说:$array = json_decode(“上面的字符串”,true); 这样变成数组 。数组总知道怎么循环了吧
陕西省网友说:服务器不给提交代码 – – 算了
https://sandbox.onlinephpfunctions.com/code/8b1f5a5921dba02a06eb8f0d604be98548602a20复制代码
贵州省网友说:好像是个JSON
{ “TotalCount”: 1, “InstanceTrafficPackageSet”: [ { “InstanceId”: “123-123”, “TrafficPackageSet”: [ { “TrafficPackageId”: “123-1234”, “TrafficUsed”: 1103114770439, “TrafficPackageTotal”: 1099511627776, “TrafficPackageRemaining”: 0, “TrafficOverflow”: 3603142663, “StartTime”: “2021-04-24T11:59:42Z”, “EndTime”: “2021-05-24T11:59:41Z”, “Deadline”: “2022-03-24T11:59:43Z”, “Status”: “OVERDUE_NETWORK_DISABLED” }] }], “RequestId”: “1-2-3-4” }复制代码
黑龙江省网友说:复制代码
福建省网友说:json转数组,直接输出数据的键值就好啦
湖南省网友说:MJJ热心人还是挺多额