<?php

$amount = "1";
$fromCurrency = "GBP";
$toCurrency = "EUR";

$url = "http://www.google.com/ig/calculator?hl=en&q=$amount${fromCurrency}=?$toCurrency";

$rawdata = file_get_contents($url);

$data = explode('"', $rawdata);
$data = explode(' ', $data['3']);

$conversionRate = $data[0];

for($i=1; $i<=20; ++$i) {
   print "$i $fromCurrency\t= " . number_format($i * $conversionRate, 2) . " $toCurrency \t";
   print "$i $toCurrency\t= " . number_format($i / $conversionRate, 2) . " $fromCurrency \t";
   print "\n";
}

?>
