<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VistaArc &#187; API</title>
	<atom:link href="http://www.vistaarc.com/category/tutorials/api/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vistaarc.com</link>
	<description>Innovative Blog</description>
	<lastBuildDate>Wed, 25 Aug 2010 14:59:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>XML-RPC in PHP :: FoXRate Currency Exchange API</title>
		<link>http://www.vistaarc.com/tutorials/xml-rpc-in-php-foxrate-currency-exchange-api</link>
		<comments>http://www.vistaarc.com/tutorials/xml-rpc-in-php-foxrate-currency-exchange-api#comments</comments>
		<pubDate>Tue, 20 Oct 2009 22:58:09 +0000</pubDate>
		<dc:creator>VistaArc</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[XML-RPC]]></category>
		<category><![CDATA[currency convert]]></category>
		<category><![CDATA[currency exchange]]></category>
		<category><![CDATA[fox-rate]]></category>
		<category><![CDATA[money exchange]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.vistaarc.com/?p=183</guid>
		<description><![CDATA[Today my friend Sakib was looking for a Currency Exchange API to implement it on one of his projects. So, I decided to write this small PHP code snippet for him. I hope this will help him and also other developers. Because, XML-RPC section of the PHP Manual is still incomplete . &#38;lt;?php /* * [...]]]></description>
			<content:encoded><![CDATA[<p>Today my friend <a href="http://think.binarylimit.com/" onclick="urchinTracker('/outgoing/think.binarylimit.com/?referer=');">Sakib</a> was looking for a <strong>Currency Exchange API</strong> to implement it on one of his projects. So, I decided to write this small <a href="http://www.php.net/" onclick="urchinTracker('/outgoing/www.php.net/?referer=');">PHP</a> code snippet for him. I hope this will help him and also other developers. Because, <a href="http://www.php.net/manual/en/ref.xmlrpc.php" onclick="urchinTracker('/outgoing/www.php.net/manual/en/ref.xmlrpc.php?referer=');">XML-RPC section of the PHP Manual</a> is still incomplete <img src='http://www.vistaarc.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .</p>
<pre class="brush: php">&amp;lt;?php

/*
* Reference :: http://foxrate.org/
*
* For $from and $to :: http://www.oanda.com/site/help/iso_code.shtml
*/

function getExchangeRate($from = &#039;USD&#039;, $to = &#039;BDT&#039;, $ammount = 1.0) {

    $ammount = doubleval($ammount);
    $request = xmlrpc_encode_request(&amp;quot;foxrate.currencyConvert&amp;quot;, array($from, $to, $ammount));

    $stream = stream_context_create(array(&#039;http&#039; =&amp;gt; array(
        &#039;method&#039; =&amp;gt; &amp;quot;POST&amp;quot;,
        &#039;header&#039; =&amp;gt; &amp;quot;Content-Type: text/xml\r\nUser-Agent: xmlrpclib.py/1.0  1 (by www.pythonware.com)\r\nHost: foxrate.org\r\n&amp;quot;,
        &#039;content&#039; =&amp;gt; $request
    )));

    $endpoint = &amp;quot;http://foxrate.org/rpc/&amp;quot;;
    $file = file_get_contents($endpoint, false, $stream);
    $response = xmlrpc_decode($file);

    if (is_array($response) &amp;amp;amp;&amp;amp;amp; xmlrpc_is_fault($response)) :
        return &#039;error&#039;;
    else :
        return $response;
    endif;
}

print_r(getExchangeRate());

?&amp;gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.vistaarc.com/tutorials/xml-rpc-in-php-foxrate-currency-exchange-api/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
