lundi 2 octobre 2017

Laravel Display USD Product mysql Price exchanged from Bitcoin

I have an liitle store with Products where all the Price are in Bitcoin also in Mysql Database in this formate:

 @else 

Now i want display the Bitcoin Price from database in USD live rate with Curl.

Whats the best method for it?

I have try it with this code,any other working ideas?:

<?php  
  $url = "http://ift.tt/19jUGsx";

  $json = file_get_contents($url);
  $data = json_decode($json, TRUE);

  $rate = $data[1]["rate"];    
  $usd_price = DB::table('products')->whereIn('category_id')     
  $bitcoin_price = round( $usd_price / $rate , 8 );
?>

<ul>
   <li>Price: <?=$usd_price ?> $ / <?=$bitcoin_price ?> BTC
</ul>



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xUD79Y
via IFTTT

3 commentaires:

  1. BitKONG is a verifiably fair online bitcoin game.

    DON'T Forget: Claim free bitcoins every 10 mins from the free btc faucet.

    RépondreSupprimer
  2. YoBit lets you to claim FREE COINS from over 100 different crypto-currencies, you complete a captcha one time and claim as many as coins you want from the available offers.

    After you make about 20-30 claims, you complete the captcha and proceed to claiming.

    You can press CLAIM as many times as 50 times per one captcha.

    The coins will safe in your account, and you can convert them to Bitcoins or any other currency you want.

    RépondreSupprimer
  3. If you're trying to BUY bitcoins online, PAXFUL is the #1 source for bitcoins as it allows buying bitcoins by 100's of different payment methods, such as MoneyGram, Western Union, PayPal, Credit Cards and they even allow exchanging your gift cards for bitcoins.

    RépondreSupprimer