You can easily convert currencies with Google conversion using the code below. Learn more about the PHP currency conversion library with google here http://mydons.com/currency-conversion-library-in-codeigniter/
public function getResult(){
$result = file_get_contents($this->googleUrl);
$result = explode('"', $result);
$convertedAmount = explode(' ', $result[3]);
$conversion = $convertedAmount[0];
$conversion = $conversion * $this->amount;
$conversion = round($conversion, 2);
$rightText = ucwords(str_replace($convertedAmount[0],"",$result[3]));
$rightText = $conversion.$rightText;
$googleLeft = explode(' ', $result[1]);
$fromAmount = $googleLeft[0];
$fromText = ucwords(str_replace($fromAmount,"",$result[1]));
$leftText = $this->amount." ".$fromText;
return $leftText." = ".$rightText;
}
source
share