Aşağıdaki kodlara bir tane de döviz kur çevirici ekledim arkadaşlar. Kullanmak isteyen arkadaşlar istediği gibi geliştirebilir, kullanabilir.

Paylaştığım Diğer Hazır Kodlar;
Süper Lig Puan Durumu (PHP)
Son Deprem Verileri (PHP)
Javascript ile Klavye Hız Testi
Javascript ile Vücut Kitle İndeksi Hesaplama
Javascript ile Kredi Hesaplama
Link Kısaltma Servisi (PHP)




<!DOCTYPE html>
<html>
<head>
    <title>Döviz Kuru Hesaplama Aracı</title>
    <style>
        body {font-family: Arial, sans-serif;background-color: #ccc;margin: 0;padding: 0;}
        h1 {text-align: center;padding: 20px;background-color: #333;color: #fff;margin: 0;}
        .container {max-width: 500px;margin: 20px auto;padding: 20px;background-color: #fff;border-radius: 5px;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);}
        label {font-weight: bold;}
        select, input[type="text"], input[type="submit"] {display: block;width: 100%;margin-bottom: 10px;padding: 10px;border: 1px solid #ccc;border-radius: 3px;font-size: 16px;}
        input[type="submit"] {background-color: #333;color: #fff;cursor: pointer;}
        .result {margin-top: 20px;font-size: 20px;text-align: center;}
    </style>
    <script>
        function updatePlaceholder() {
            var fromCurrencySelect = document.getElementsByName('from_currency')[0];
            var selectedCurrency = fromCurrencySelect.options[fromCurrencySelect.selectedIndex].value;
            document.getElementsByName('amount')[0].placeholder = selectedCurrency;
        }
    </script>
</head>
<body>
    <h1>Döviz Kuru Hesaplama Aracı</h1>
    <div class="container">
        <?php
        if ($_SERVER["REQUEST_METHOD"] === "POST") {
            $tcmbURL = 'https://www.tcmb.gov.tr/kurlar/today.xml';
            $xml = simplexml_load_file($tcmbURL);
            
            if ($xml !== false) {
                $dovizKurlari = array(
                    'TRY' => "1",
                    'USD' => (float) $xml->Currency[0]->BanknoteSelling,
                    'EUR' => (float) $xml->Currency[3]->BanknoteSelling,
                    'GBP' => (float) $xml->Currency[4]->BanknoteSelling,
                    'AUD' => (float) $xml->Currency[1]->BanknoteSelling,
                    'CHF' => (float) $xml->Currency[5]->BanknoteSelling,
                    'CAD' => (float) $xml->Currency[7]->BanknoteSelling,
                    'KWD' => (float) $xml->Currency[8]->BanknoteSelling
                );
                $fromCurrency = strtoupper($_POST['from_currency']);
                $amount = floatval($_POST['amount']);
                $toCurrency = strtoupper($_POST['to_currency']);
                if (array_key_exists($fromCurrency, $dovizKurlari) && array_key_exists($toCurrency, $dovizKurlari)) {
                    $conversionResult = $amount * ($dovizKurlari[$fromCurrency] / $dovizKurlari[$toCurrency]);
                    $conversionResult = number_format($conversionResult, 2);
                    echo "<p class='result'>$amount $fromCurrency = $conversionResult $toCurrency</p>";
                } else {
                    echo "<p class='result'>Geçersiz döviz cinsi seçimi.</p>";
                }
            } else {
                echo "<p class='result'>Döviz kurları çekilemedi.</p>";
            }
        }
        ?>
        <form action="" method="post">
            <label for="amount">Miktar:</label>
            <input type="text" name="amount" placeholder="TRY" required>
            <label for="from_currency">Dönüştürülecek Döviz:</label>
            <select name="from_currency" onchange="updatePlaceholder()">
                <option value="TRY">(TRY) TÜRK LİRASI</option>
                <option value="USD">(USD) ABD DOLARI</option>
                <option value="EUR">(EUR) EURO</option>
                <option value="GBP">(GBP) İNGİLİZ STERLİNİ</option>
                <option value="AUD">(AUD) AVUSTRALYA DOLARI</option>
                <option value="CHF">(CHF) İSVİÇRE FRANGI</option>
                <option value="CAD">(CAD) KANADA DOLARI</option>
                <option value="KWD">(KWD) KUVEYT DİNARI</option>
            </select>
            <label for="to_currency">Hedef Döviz:</label>
            <select name="to_currency"">
                <option value="TRY">(TRY) TÜRK LİRASI</option>
                <option value="USD">(USD) ABD DOLARI</option>
                <option value="EUR">(EUR) EURO</option>
                <option value="GBP">(GBP) İNGİLİZ STERLİNİ</option>
                <option value="AUD">(AUD) AVUSTRALYA DOLARI</option>
                <option value="CHF">(CHF) İSVİÇRE FRANGI</option>
                <option value="CAD">(CAD) KANADA DOLARI</option>
                <option value="KWD">(KWD) KUVEYT DİNARI</option>
            </select>
            <input type="submit" value="Hesapla">
        </form>
    </div>
</body>
</html>