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.
<?php $currency=$_POST['currency']; $place = $_POST['place']; $ARS= 0.06586; $BSD=0.02129; $BRL=0.03794; $CAD=0.02286; $COP=44.56140; switch($place){ case "Argentine Peso": $a=($currency*$ARS); echo "<p>Php $currency is equivalent to $a ARS in Argentina</p>"; break; case "Bahamian Dollar": $b=($currency*$BSD); echo "<p>Php $currency is equivalent to $b BSD in Bahama</p>"; break; case "Brazilian Real": $c=($currency*$BRL); echo "<p>Php $currency is equivalent to $c BRL in Brazil</p>"; break; case "Canadian Dollar": $d=($currency*$CAD); echo "<p>Php $currency is equivalent to $d CAD in Canada</p>"; break; case "Colombian Peso": $e=($currency*$COP); echo "<p>Php $currency is equivalent to $e COP in Colombia</p>"; } //REFERENCE: http://www.exchange-rates.org/currentRates/PHP ?>
Sumber: sourcodester.com
Tidak ada komentar:
Posting Komentar