Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <style>
- body {
- font-family: Gotham, Helvetica Neue, Helvetica, Arial," sans-serif";
- font-size: 30px;
- text-align: center;
- background: #03a9f4;
- color: #fff;
- font-weight: bold;
- }
- </style>
- </head>
- <body>
- <?php
- $url = "https://api.coinmarketcap.com/v1/ticker/ripple/?convert=EUR";
- $contents = file_get_contents($url);
- $contents = utf8_encode($contents);
- $results = json_decode($contents);
- //print_r($results[0]);
- $quantita = 57000;
- $valore_in_dollari = $results[0]->price_usd;
- $valore_in_euro = $results[0]->price_eur;
- $valore_totale_dollari = $quantita*$valore_in_dollari;
- $valore_totale_euro = $quantita*$valore_in_euro;
- $partemia = ($valore_totale_euro)/10;
- //echo "Valore totale: "; echo number_format($valore_totale_dollari); echo " $<br>";
- echo "Valore totale: "; echo number_format($valore_totale_euro); echo " €<br>";
- echo "Parte mia: "; echo number_format($partemia); echo " €";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement