PHP 7 Script to Build a Currency Converter Using Fixer.io API in Browser Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments

 

Welcome folks today in this blog post we will be building a currency converter using fixer.io api in browser using php 7. All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to make an index.php file and copy paste the following code

 

 

index.php

 

 

<?php


$api="your api key here";   ///// Provide your fixer.io api key here


$string = file_get_contents("http://data.fixer.io/api/latest?access_key=$api&format=1");
  $json = json_decode($string, true);
  
  
  $i=0;
  foreach ($json['rates'] as $key => $value) {
    $currency[$i]=$key;
    $rate[$i]=$value;
    $i=$i+1;
        
  }
  
?>

Leave a Reply