April 9, 2014 12:55 pm

How to Convert Currency using Google Finance in PHP

In this tutorial I am going to show you How to use Google finance Currency Converter and convert currencies very easily in PHP. It takes an amount and 2 currencies from and to and then send it to Google finance using HTTP request and get the amount value converted in given currency, we have used curl to send request. In final stage we parse response and show results.

How to Convert Currency using Google Finance in PHP

Index.php Contains PHP code to show drop-down lists for conversion with a text box.

In drop-down we have added few values you can get complete drop-down by downloading script. Included convert.php file contains a function which send HTTP request and return response back. convert.php Contains a function which send HTTP request and return response back.

This function accept 3 parameters and send request to Google finance using HTTP and it will return complete code.

I hope this simple tutorial help you and please don’t forget to give us your feedback.

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.


Tutorial Categories:
  • Cool! Well written. Do you know, if Google allows us officially to use it that way?

    • huzoorbux

      Google is super smart, I don’t think so that its against there rules that’s why I am able to use it..

  • Dmitri

    How do I make it work in a html page? Thanks

  • Alex xaoc

    Hi, ive added my e-mail address to the subscribers list and i still cant download the code 🙁