News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPSnippets.info:
Convert currencies using PHP, Google and cURL
July 19, 2010 @ 08:16:30

From the PHPSnippets.info site there's a recent post about using a conversion tool from Google to convert currency values from one type to another.

Just a few people know that Google have a built-in currencies calculator. (Just type 100$ in euros in Google search box if you want to test it) This calculator works very well, so what about using PHP and cURL and get this functionnality in your own web app?

The script makes a cURL request over to the Google API's calculator feature and passes in the amount to convert and the codes for the "to" and "from" (like USA, CAD or EUR). You'll need cURL support in your PHP installation to use the script, but it wouldn't be all that difficult to modify it to use a basic socket connection too.

1 comment voice your opinion now!
convert currency google curl tutorial snippet


blog comments powered by Disqus

Similar Posts

BillS' IIS Blog: How to install PHP on IIS7 (RC1)

Wez Furlong's Blog: HTTP POST from PHP, without cURL

DevShed: Defining the Core Structure of a PHP Blogger

Kevin Schroeder's Blog: A little more advanced ZF2 EventManager usage

PHP-GTK Blog: How to: PHP 5.3 with PHP-GTK and Cairo on Linux Mint 9


Community Events





Don't see your event here?
Let us know!


install language configure series symfony interview bugfix developer code laravel podcast threedevsandamaybe library api list application release community wordpress introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework