Advertisement
Guest User

Untitled

a guest
Jan 18th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <html>
  2. <head>
  3. <style>
  4. body {
  5. font-family: Gotham, Helvetica Neue, Helvetica, Arial," sans-serif";
  6. font-size: 30px;
  7. text-align: center;
  8. background: #03a9f4;
  9. color: #fff;
  10. font-weight: bold;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15.  
  16. <?php
  17. $url = "https://api.coinmarketcap.com/v1/ticker/ripple/?convert=EUR";
  18. $contents = file_get_contents($url);
  19. $contents = utf8_encode($contents);
  20. $results = json_decode($contents);
  21. //print_r($results[0]);
  22. $quantita = 57000;
  23. $valore_in_dollari = $results[0]->price_usd;
  24. $valore_in_euro = $results[0]->price_eur;
  25.  
  26. $valore_totale_dollari = $quantita*$valore_in_dollari;
  27. $valore_totale_euro = $quantita*$valore_in_euro;
  28. $partemia = ($valore_totale_euro)/10;
  29. //echo "Valore totale: "; echo number_format($valore_totale_dollari); echo " $<br>";
  30. echo "Valore totale: "; echo number_format($valore_totale_euro); echo " &euro;<br>";
  31. echo "Parte mia: "; echo number_format($partemia); echo " &euro;";
  32.  
  33. ?>
  34. </body>
  35. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement