2 thoughts on “Learn How to Create a Currency Converter Using PHP

  1. Philippine Money Changer

    Amount:

    Currency:

    Korean Won
    US Dollar
    Singapore Dollar

    <?php
    $currency=$_POST['currency'];
    $amount=$_POST['amount'];

    if ($currency=='won')
    {
    echo "Your Converted Amount is:“;
    echo $amount*21.51941;
    }
    else if($currency==’usd’)
    {
    echo “Your Converted Amount is:“;
    echo amount*50.6112;
    }
    else ($currency==’sd’)
    {
    echo “Your Converted Amount is:“;
    echo amount*37.4800;
    }

    ?>

    Hi! I am novice on using PHP. This is so far my second output but doesn’t work at all.

    When I check the localhost, it says
    Parse error: syntax error, unexpected ‘{‘ in C:\xampp\htdocs\Activity 2\Converter.php on line 18.

    Why is that? Need your help.
    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *