Your Ad Here

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




 Sponsors
 Links
finance products
dropshippers
software directory
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


A currency convertor


A currency convertor

This is a currency convertor which allows a user to get the latest currency conversions from Yahoo . This example will convert 1 British pound to 5 other currencies .

Code:

<?
//our currencies
$currency = array("Yen","US Dollars","German mark","french franc","Australian dollar");
//the various URLS for the currency conversions
$conv[0]=file('http://quote.yahoo.com/m5?a=1&s=GBP&t=JPY&c=0');
$conv[1]=file('http://quote.yahoo.com/m5?a=1&s=GBP&t=USD&c=0');
$conv[2]=file('http://quote.yahoo.com/m5?a=1&s=GBP&t=DEM&c=0');
$conv[3]=file('http://quote.yahoo.com/m5?a=1&s=GBP&t=FRF&c=0');
$conv[4]=file('http://quote.yahoo.com/m5?a=1&s=GBP&t=AUD&c=0');
//loop through results
for($i=0; $i<sizeof($conv); $i++)
{
$conv[$i] = join("",$conv[$i]);
//parse out the relevant information
$conv[$i] = ereg_replace(".*<table border=1 cellpadding=2 cellspacing=0>",'',$conv[$i]);
$conv[$i] = ereg_replace("</table>.*",'',$conv[$i]);
$conv[$i] = ereg_replace("</b>.*",'',$conv[$i]);
$conv[$i] = ereg_replace(".*<b>",'',$conv[$i]);
//display results
echo "1 Pound(£) = ".$conv[$i]." ".$currency[$i]."<br>\n";
}
?>

Example :

 

1 Pound(£) = Currency Converter - Yahoo! Finance
Yen
1 Pound(£) = Currency Converter - Yahoo! Finance
Yahoo! FinanceFinance Home - My Yahoo - Yahoo! - Help 

US Dollars
1 Pound(£) = Currency Converter - Yahoo! Finance
Yahoo! FinanceFinance Home - My Yahoo - Yahoo! - Help 

German mark
1 Pound(£) = Currency Converter - Yahoo! Finance
Yahoo! FinanceFinance Home - My Yahoo - Yahoo! - Help 

french franc
1 Pound(£) = Currency Converter - Yahoo! Finance
Yahoo! FinanceFinance Home - My Yahoo - Yahoo! - Help 

Australian dollar


 

Yahoo! FinanceFinance Home - My Yahoo - Yahoo! - Help 




Books
 Sponsors
 Random Code
find a string in another(string)
count the number of rows ina MySQL database(database)
US population(internet)
 Random Article
  Network
Programming resources
Tutorials directory
Clickbank mall
sell software
Free auctions, low cost stores
UK products
US products
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
DVD site
Domain names
Dating site
Software directory
Maxi directory
bigarticle : free articles




beginners PHP Copyright © 2004 onwards by beginnersPHP.