【问题标题】:PHP Steam Inventory JSon DecoderPHP Steam 库存 JSon 解码器
【发布时间】:2015-10-05 05:17:04
【问题描述】:

我以前从未与json 合作过,我不确定如何充分利用。所以基本上我需要得到rgDescriptions 表中的所有项目,但老实说我不确定如何去做。

所以,如果有人能指出我正确的方向,那就太好了。我试图在 Json 上寻找文档/教程,但似乎找不到高级的东西。

只有{"id":"2","instanceID":"8"}这样的东西

Example of the json I want to decode

【问题讨论】:

  • 你想从那个json字符串中得到idinstanceId是吗??
  • 我刚刚发布了我需要解码的 json 文本的链接。我正在苦苦挣扎,因为它的文字量很大,而且很难阅读。

标签: php json steam steam-web-api


【解决方案1】:

使用json_desode() 解码json格式。

$json = '{"id":"2","instanceID":"8"}';
$decoded = json_decode($json);
print_r($decoded);// will print decoded format of your json
echo $decoded->id; // outputs => 2
echo $decoded->instanceID; // outputs => 8

输出:

stdClass Object
(
    [id] => 2
    [instanceID] => 8
)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-05-24
    • 2016-05-27
    • 1970-01-01
    • 1970-01-01
    • 2014-07-24
    • 2014-06-04
    • 2018-04-02
    相关资源
    最近更新 更多