php - Json output array to php variable
问题描述
prob an easy fix, but I'm stuck.
So print_r($data) =
stdClass Object (
[code] => 200000
[data] => stdClass Object (
[accountEquity] => 111
[unrealisedPNL] => 111
[marginBalance] => 111
[positionMargin] => 111
[orderMargin] => 0
[frozenFunds] => 0
[availableBalance] => 111
[currency] => xxx
)
)
And echo $data->code
outputs '20000
'
But I can not get the other 'variables' to work. Ive tried:
$data->code->data->accountEquity
$data[1]->accountEquity
$data->code->data->accountEquity
What is the right format to get those other values?
Thank you. gr Mike
解决方案
最好的获取方式accountEquity
是
$data->data->accountEquity
推荐阅读
- reactjs - 如何调试 WordPress React 插件?
- gdb - 从 spi 配置返回时,Arty-A7-100T 上 E310 上的 example-spi 卡住了
- javascript - Google Apps 脚本 Oauth1 / Trello API“无效签名”
- bazel - Jenkins(Linux,CentOS)上的 Bazel 本地 JDK 权限问题
- swiftui - ForEach 循环中单元格的屏幕截图
- python - python dotenv CLI 的正确文件规范?
- uwp - C++Winrt 如何从异步方法中抛出异常
- java - Java非贪婪(?)正则表达式匹配字符串
- snowflake-cloud-data-platform - 雪管 REST API 插入报告“文件”:[]
- jpa - JPA:使用fluent或@Query对OneToMany关系的子表进行连接和排序/限制约束