<?php $amount = '123.45'; $fromCurrency = 'EUR'; $toCurrency = 'USD'; $data = json_decode(file_get_contents('http://api.rest7.com/v1/currency_convert.php?amount=' . $amount . '¤cy_in=' . $fromCurrency . '¤cy_out=' . $toCurrency)); if (@$data->success !== 1) { die('Failed'); } echo $data->amount . ' ' . $data->currency_out;