-1

I have the following stdClass, how can I print the objects data inside?

Array
(
    [USD] => stdClass Object
        (
            [15m] => 94.60177
            [last] => 94.60177
            [buy] => 94.61019
            [sell] => 94.66024
            [24h] => 94.51
            [symbol] => $
        )

    [CNY] => stdClass Object
        (
            [15m] => 580.38036
            [last] => 580.38036
            [buy] => 569.24441
            [sell] => 593.90802
            [24h] => 577.26
            [symbol] => ¥
        )
)

I need to access for example USD->15m Tried with something like $blockchain_array->USD->15m with no luck. Thank you!

4

2 回答 2

1
$blockchain_array['USD']->{'15m'}
于 2013-07-25T09:01:50.173 回答
1

干得好。

echo $blockchain_array['USD']->{'15m'};
于 2013-07-25T09:04:43.963 回答