PHP: Currency Exchange using XML-RPC client
Jon Moffet
This is an example PHP code I wrote to demonstrate how to connect to Foxrate Currency Exchange server and retrieve the latest exchange rate.
The example uses The Incutio XML-RPC for PHP library. Please visit refer to Incutio XML-RPC Library Manual for further in-depth reference.
PHP:
-
require('IXR.inc.php');
-
-
// connect to foxrate.org currency exchange server
-
$client = new IXR_Client('http://foxrate.org/rpc/');
-
-
//make the currency exchange
-
if (!$client->query('foxrate.currencyConvert', 'USD', 'GBP',1000)) {
-
}
-
-
$response = $client->getResponse();
The demo shows you how to get the current value of USD 1000 in British Pound (GBP). Hopefully this example will be useful for you to build a working currency exchage webapp using foxrate.org api
Download the sample code here : foxrate_rpc_1.zip
Tags: xmlrpc, xml-rpc, foxrate, currency exchange, foreign exchange, web api, rpc
Posted in Uncategorized |








August 21st, 2007 at 4:04 pm