You are viewing a single comment's thread from:

RE: How to get HIVE and HBD prices from API with PHP

in HiveDevs2 years ago

Nice piece of code. One suggestion, you could try out is that you don't need to use 2 foreach loops. json_decode when set to TRUE returns an associative array. So you can just call the index of the array. Like:

echo "<b>HIVE : </b>" . $hiveprice['USD'] . "</br>";
echo "<b>HBD : </b>" . $hbdprice['USD']; 

And it will display just like the loops. Happy coding!

Sort:  

Oh, thanks that’s simplify it a lot!!