Your Ad Here

 Navigation

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

 Sponsors
 Links
golfing products
domain names
gambling sites
 Downloads
 Misc

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming



Currency Conversion (pounds)


Currency Conversion (pounds)

This function will take a value in pounds and a country and will convert the pounds to the currency of the country . Note this function has the currency exchange rates of 23/07/2001 , if you wished to use this on your site you would have to update this every day at least . This would be easy to convert so you could convert from dollars to other currencies .

We used the currency exchange info from this site

Valid countries are us , japan , france , italy , canada , germany and australia

Here is our function

<?php
function ConvPounds($pounds , $country)
{
$rate = 0;
switch($country)
{
Case "us" :
$rate = 1.41973 ;
break;
Case "japan" :
$rate = 176.154 ;
break;
Case "france" :
$rate = 10.7552 ;
break;
Case "italy" :
$rate = 317475 ;
break;
Case "canada" :
$rate = 2.19297 ;
break;
Case "germany" :
$rate = 3.20583 ;
break;
Case "australia" :
$rate = 2.79862 ;
break;
default :
$rate = 0;
break;
}
return $pounds * $rate;
}
?>

And here is our test script

<?php
//test our function
//convert 10 pounds to us dollars
echo ConvPounds(10 , "us");
echo "<br>";
//convert 25 pounds to french francs
echo ConvPounds(25 , "france");
?>




Books
 Sponsors
 Random Code
The Register news(xml)

Get stock quotes(internet)

store a text file into an array(beginner)

 Random Article
  Network

Programming resources
Tutorials directory
General bid directory
sell software, make money
Find me wholesalers
Find me dropshippers
Free recipes online/a>
UK products and price comparison
Anime videos
Free lyrics search
free stuff
UK stores
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
Golf resources
iPod resources
Coupons and deals
Baby names
Domain names
Dating site
Scripts directory
Maxi directory
bigarticle : free articles
dawgwitch search
List of directories






beginners PHP Copyright © 2004 onwards by beginnersPHP.