Currency Conversion using PHP

I am working on a shopping cart website project, which is still in development phase.
I want to display the rates of the products in INR(Indian Rupees) and USD(US Dollars).
Can someone help me with a php code for doing the live currency conversion.
I want to know how can I collect the live currency values in a php variable to do the conversion.

For example: If I go to the link http://www.xe.com/ucc/convert.cgi?From= … R&Amount=1
Here I can get the live rate for US dollars to INR conversion. As It is shown in the picture below.
[attachment=0]a.JPG[/attachment]

In the picture it is also shown that 1 INR = 0.0214083 USD (This is the live current value).
Is there any way I can collect the live current value of the currency in a variable?
Please help me in resolving this issue, or please point me to the right direction.

You can’t specifically get the conversion rates from XE using just PHP unless you pay for their feed, which is $540. I had originally thought you may be able to use curl(), however it is against their terms of service and so I doubt anyone would be help you on this forum.

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with the rest other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by MediaTemple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.