0

i have this array:

Array
(
    [0] => stdClass Object
        (
            [MarketCurrency] => LTC
            [BaseCurrency] => BTC
            [MarketCurrencyLong] => Litecoin
            [BaseCurrencyLong] => Bitcoin
            [MinTradeSize] => 0.03039514
            [MarketName] => BTC-LTC
            [IsActive] => 1
            [IsRestricted] => 
            [Created] => 2014-02-13T00:00:00
            [Notice] => 
            [IsSponsored] => 
            [LogoUrl] => https://bittrexblobstorage.blob.core.windows.net/public/6defbc41-582d-47a6-bb2e-d0fa88663524.png
        )

    [1] => stdClass Object
        (
            [MarketCurrency] => DOGE
            [BaseCurrency] => BTC
            [MarketCurrencyLong] => Dogecoin
            [BaseCurrencyLong] => Bitcoin
            [MinTradeSize] => 462.96296296
            [MarketName] => BTC-DOGE
            [IsActive] => 1
            [IsRestricted] => 
            [Created] => 2014-02-13T00:00:00
            [Notice] => 
            [IsSponsored] => 
            [LogoUrl] => https://bittrexblobstorage.blob.core.windows.net/public/a2b8eaee-2905-4478-a7a0-246f212c64c6.png
        )

}

I would get the "MarketCurrency" data and "BaseCurrency" data. But I don't know how to do.

How can I do this?

I need your help.

1 Answer 1

1

You can do it with simple foreach() to grab the objects.

foreach($data as $obj){
  echo "MarketCurrency = $obj->MarketCurrency and BaseCurrency = $obj->BaseCurrency".PHP_EOL;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.