O'Reilly logo

PHP Ajax Cookbook by R. Rajesh Jeba Anbiah, Roshan Bhattarai, Milan Sedliak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting currencies using Ajax and PHP

In this recipe, we will see how to convert currencies using Ajax and PHP. In this example, we will use the API provided by foxrate.org. Forxrate.org has provided the web services in the XML-RPC format. We consumed an XML-RPC web service in this example.

Getting started

Foxrate.org's currency convertor API is located at: http://foxrate.org/rpc/. The method name for the XML-RPC call is foxrate.currencyConvert. The parameters that can be passed to this function are:

  • From currency This is the code of the currency in which original currency amount is in. Examples can be USD or GBP. The list of currency codes of currencies can be found here: http://en.wikipedia.org/wiki/ISO_4217.
  • Targetted currency This is the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required