Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Books
Sample Chapters
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
wwwstores
domain names
finance products
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


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
Display gravatars(Wordpress)
Random title(randomizing)
decimal to octal conversion(math)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.