$data[0]->name, "price" => $data[0]->current_price, "total_volume" => $data[0]->total_volume, "price_change_24h" => $data[0]->price_change_24h, "percent_change_usd_24" => $data[0]->price_change_percentage_24h ); // Assign objects for each given coin: $this->currencies[$cryptocurrency] = $query; } # Print all requested cryptocurrencies. public function print_cryptocurrencies($cryptocurrencies){ foreach($cryptocurrencies as $coin){ $this->display_currency($coin); } echo(json_encode($this->currencies)); } } # Define the new 'coin' class object. $coin = new cryptocurrency_tracker(); # Get data on this list of cryptocurrencies: Bitcoin, Ethereum, Binance Coin, XRP, Tether $coin->print_cryptocurrencies(array("bitcoin", "ethereum", "binancecoin", "ripple", "tether")); ?>