PHP Examples

Coding against our API is pretty straightfoward in PHP you can expect JSON responses to be returned from our API which can then be decoded into PHP arrays. If you would like to contribute PHP code samples please contact us and send them in and we will add them to this page.


 // get current exchange rates

 $exurl = 'http://api.exchangeratelab.com/api/current?apikey=';

 $ch = curl_init($exurl);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

 $json_response_content = curl_exec($ch);

 $exchangeRatesResult = json_decode($json_response_content, true );


ExchangeRateLab © 2013 - 2015