Simple Currency Converter in PHP API

Simple Currency Converter in PHP API

In this Post We Will Explain About is Simple Currency Converter in PHP API With Example and Demo.Welcome on Live24u.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Currency Converter Using PHP Example

In this post we will show you Best way to implement Currency conversion in PHP Using Google API, hear for How to Create a Simple Basic Currency Converter in PHP with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.




Getting started:

First of all you have to simple download as well as install XAMPP server / Wampp server or any local server that run PHP Source code. In This POST I used XAMPP server as my local any server, So this here the link for main Download XAMPP server

Also Read :   How to use AngularJS with Laravel Blade Together

The Main Function

This Scripts Data contains the main function of the web application, This Scripts will try to step by step convert the HTML input txtdigit then convert it based on the conversion currency that use. To make this just write these div block of Scripts in the text main editor,And then name It PHP file as live_convert.php

<?php
	if(ISSET($_GET['form_submit_btn'])){
		$txtdigit = $_GET['live_txt_digit'];
		$currency = $_GET['currency'];
		if($txtdigit != ""){
			switch($currency){
				case "Dollar":
					$myoutput = $txtdigit * 51.52;
					echo"<strong><label class='text-success' style='font-size:28px;'>$".$myoutput."</label></strong>";
				break;
 
				case "Euro":
					$myoutput = $txtdigit * 63.62;
					echo"<strong><label class='text-success' style='font-size:28px;'>€".$myoutput."</label></strong>";
				break;
 
				case "Pound":
					$myoutput = $txtdigit * 72.24;
					echo"<strong><label class='text-success' style='font-size:28px;'>£".$myoutput."</label></strong>";
				break;
 
				case "Chinese Yuan":
					$myoutput = $txtdigit * 8.12;
					echo"<strong><label class='text-success' style='font-size:28px;'>¥".$myoutput."</label></strong>";
				break;
 
				case "Japanese Yen":
					$myoutput = $txtdigit * 0.47;
					echo"<strong><label class='text-success' style='font-size:28px;'>¥".$myoutput."</label></strong>";
				break;
			}
		}
	}
?>

The Main Interface

This is the main interface that display the myoutput of the currency conversion,to make this just write these scripts inside your text file, After That save it as index.php

Also Read :   Difference between break and continue in PHP | Break and Continue

<!DOCTYPE html>
<html lang="en">
	<head>
	<title>PHP - Simple Currency Converter</title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
		<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/>
	</head>
<body>
	<nav class="live navbar navbar-default">
		<div class="live container-fluid">
			<a class="navbar-brand" href="<a href="http://live24u.com">Live24u.com</a>
		</div>
	</nav>
	<div class="live24u col-md-3"></div>
	<div class="live24u col-md-6 well">
		<h3 class="text-success">Live PHP - Simple Currency Converter Example</h3>
		<hr style="border-top:1px dotted #3d3d3d;"/>
		<form method="GET" action="">
			<div class="form-inline">
				<label>PHP:</label>
				<input class="live24u form-control" type="text" name="live_txt_digit"/>
				<label>Select Any Currency: </label>
				<select name="currency" class="live24u form-control">
					<option value="">Select an Currency</option>
					<option value="Dollar">Dollar</option>
					<option value="Euro">Euro</option>
					<option value="Pound">Pound</option>
					<option value="Chinese Yuan">Chinese Yuan</option>
					<option value="Japanese Yen">Japanese Yen</option>
				</select>
				<br /><br />
				<strong><button type="submit" name="form_submit_btn" class="btn btn-success form-control" style="width:30%;">Convert</button></strong>
				<br />
				<?php require 'live_convert.php'?>
			</div>
		</form>
	</div>
</body>
</html>

There for you have it we all steps successfully created a Simple Currency Converter in PHP. We hope that It simple post help you to what you are Learning for. For more updates and blogs just kindly visit It site. Good Luck!!

Also Read :   JSON - Introduction using PHP-Angularjs -javascript

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example





Example

I hope you have Got What is PHP – Simple Currency Converter And how it works.I would Like to have FeedBack From My Blog(live24u.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(live24u.com) Are Most Always Welcome.