Bitcoin Forum
December 09, 2016, 11:20:40 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Valeur Bitcoin actualisée - Script PHP  (Read 2682 times)
pharaon
Full Member
***
Offline Offline

Activity: 124



View Profile
September 27, 2011, 03:36:46 PM
 #1

Bonjour,

Voici un petit bout de code qui vous permet d'obtenir assez facilement la valeur moyenne en Euros, Dollars, etc... sur plusieurs jours (24h, 7jours ou 30jours)

<?php
// on récupère la valeur dans toutes les monnaies disponibles.
$string = file_get_contents("http://bitcoincharts.com/t/weighted_prices.json");

// on en fait un jolie tableau.
$json_a = json_decode($string,true);

//ici on choisi d'afficher la moyenne en EURO des 7 derniers jours.
$eur7 =  $json_a["EUR"]["7d"];

echo $eur7;
?>

Voilà, pratique et simple, vous pouvez l'utiliser pour actualiser le prix d'article dans votre boutique automatiquement en fonction du cours du Bitcoin.

1481325640
Hero Member
*
Offline Offline

Posts: 1481325640

View Profile Personal Message (Offline)

Ignore
1481325640
Reply with quote  #2

1481325640
Report to moderator
1481325640
Hero Member
*
Offline Offline

Posts: 1481325640

View Profile Personal Message (Offline)

Ignore
1481325640
Reply with quote  #2

1481325640
Report to moderator
1481325640
Hero Member
*
Offline Offline

Posts: 1481325640

View Profile Personal Message (Offline)

Ignore
1481325640
Reply with quote  #2

1481325640
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
inetketing
Newbie
*
Offline Offline

Activity: 10



View Profile WWW
March 09, 2013, 09:58:08 AM
 #2

Je te remerci énormement !
J'ai beaucoup chercher pour cette ligne de code!!

Bitcoins > You.
Bitcoin Faucet : http://freebitcoinsgiveaway.com (http://freebitcoinsgiveaway.com)
My personal website : http://ibitcoins.com (http://ibitcoins.com)
Yash
Jr. Member
*
Offline Offline

Activity: 57



View Profile
August 10, 2013, 10:52:22 AM
 #3

Ca m'a donné une fausse valeur lol je doute que ca marche ces jours-ci

Feel free to share your BTC with me ^^  1P44fQgQpsBeUBXcdHoKcK4YCyEbgeccVj
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!