首页 > 解决方案 > 如何使用 php 从 json 打印特定值?

问题描述

嗨,我需要这个 json:

{
   "data":{
      "user_quota":[
         {
            "group_limit":10240,
            "quota":0,
            "support_share_quota":false,
            "used":10.09765625,
            "volume":"\/volume1"
         }
      ]
   },
   "success":true
}


$decode = json_decode($curl, true);

需要打印这一行:“group_limit”:xxxx

我怎么写?虽然我正在寻找 hedlam 我找不到任何有用的东西来列出它

谢谢

标签: phpjson

解决方案


我从 curl 中获取 .. 我可能需要在 php 中传输到 json .. 什么时候使用这个:json_encode($curl) 原始输出是:{"data":{"user_quota":[{"group_limit":10240,"quota":0,"support_share_quota":false,"used":10.09765625,"volume":"\/volume1"}]},"success":true}


推荐阅读