【问题标题】:Encoding/Getting single result from array编码/从数组中获取单个结果
【发布时间】:2017-08-27 21:33:57
【问题描述】:

所以我有这个数组

object(stdClass)#19 (2) { ["status"]=> string(7) "success" ["data"]=> object(stdClass)#14 (6) { ["network"]=> string(3) "BTC" ["txid"]=> string(64) "128830010b4773bb9a88f9c53b67217f37caa092bfd477a81a2f41d6ea804e53" ["amount_withdrawn"]=> string(10) "0.00087298" ["amount_sent"]=> string(10) "0.00050000" ["network_fee"]=> string(10) "0.00037298" ["blockio_fee"]=> string(10) "0.00000000" } }

但是我不确定如何获取txid等单个数据,我不确定它是json还是..

【问题讨论】:

    标签: php json var


    【解决方案1】:

    就是这样:

      $myarray = (array) $my_var ; // what u have is a class and not an array, just cast it
    
     echo $myarray["data"]["txid"];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-30
      • 2011-07-09
      • 2018-05-15
      • 2011-09-15
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多