I have this array converted by json_decode collected from an api :
Array ( [Success] => 1 [Message] => [Data] => Array ( [0] => Array ( [TradePairId] => 1261 [Label] => $$$/BTC [AskPrice] => 3.1E-7 [BidPrice] => 3.0E-7 [Low] => 3.0E-7 [High] => 3.2E-7 [Volume] => 705593.52096319 [LastPrice] => 3.0E-7 [BuyVolume] => 25256894.050968 [SellVolume] => 18662564.012659 [Change] => 0 [Open] => 3.0E-7 [Close] => 3.0E-7 [BaseVolume] => 0.21205524 [BuyBaseVolume] => 1.29049546 [SellBaseVolume] => 25462.44174616 ) [1] => Array ( [TradePairId] => 1263 [Label] => $$$/DOGE [AskPrice] => 0.5899991 [BidPrice] => 0.46100022 [Low] => 0.46100044 [High] => 0.6 [Volume] => 16724.82996554 [LastPrice] => 0.49000028 [BuyVolume] => 44142637347.254 [SellVolume] => 431226.52315815 [Change] => -18.33 [Open] => 0.6 [Close] => 0.49000028 [BaseVolume] => 8561.99438073 [BuyBaseVolume] => 108392.69695843 [SellBaseVolume] => 8677417.2428937 )......
I need to display only Label and LastPrice.
I am trying with this :
<?php
$jsondata = file_get_contents('https://www.cryptopia.co.nz/api/GetMarkets');
$data = json_decode($jsondata, true);
foreach ($data['0']['Label'] as $key=>$val) {
print_r($key);
}
//print_r($data);
?>
but could not succeed.