Home

Konverter mata uang di PHP




Sebuah currency converter yang mengubah Peso Filipina ke dalam mata uang yang berbeda. Nilai-nilai setiap mata uang akan berubah tergantung pada nilai pasar saat ini.
  1. <?php
  2. $currency=$_POST['currency'];
  3. $place = $_POST['place'];
  4. $ARS= 0.06586;
  5. $BSD=0.02129;
  6. $BRL=0.03794;
  7. $CAD=0.02286;
  8. $COP=44.56140;
  9. switch($place){
  10. case "Argentine Peso":
  11. $a=($currency*$ARS);
  12. echo "<p>Php $currency is equivalent
  13. to $a ARS in Argentina</p>";
  14. break;
  15. case "Bahamian Dollar":
  16. $b=($currency*$BSD);
  17. echo "<p>Php $currency is equivalent
  18. to $b BSD in Bahama</p>";
  19. break;
  20. case "Brazilian Real":
  21. $c=($currency*$BRL);
  22. echo "<p>Php $currency is equivalent
  23. to $c BRL in Brazil</p>";
  24. break;
  25. case "Canadian Dollar":
  26. $d=($currency*$CAD);
  27. echo "<p>Php $currency is equivalent
  28. to $d CAD in Canada</p>";
  29. break;
  30. case "Colombian Peso":
  31. $e=($currency*$COP);
  32. echo "<p>Php $currency is equivalent
  33. to $e COP in Colombia</p>";
  34. }
  35. //REFERENCE: http://www.exchange-rates.org/currentRates/PHP
  36. ?>


Sumber: sourcodester.com

Unknown

Tempat Tutorial coding dan contoh-contoh aplikasi baik itu php,mysql,android,java, dan html.

Tidak ada komentar:

Posting Komentar