The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Currency Conversion using PHP

  • # December 30, 2009 at 3:23 am

    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 … R&Amount=1
    Here I can get the live rate for US dollars to INR conversion. As It is shown in the picture below.

    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.

    # January 1, 2010 at 7:53 pm

    This reply has been reported for inappropriate content.

    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.

    There are numerous other sites that will give you free conversion XML files which you can then parse with SimpleXML(). For example, Euro conversion can be found here

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed