0

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

4

2 回答 2

1

最好的获取方式accountEquity

$data->data->accountEquity
于 2021-07-28T07:48:52.937 回答
0

The right way to access accountEquity is:

$data->data->accountEquity

But you could also cast the object to an array with:

$data = (array) $data;

Then accountEquity is reached by:

$data['data']['accountEquity']
于 2021-07-28T07:25:19.940 回答