Hi im trying to write a currency converting php script, utilizing the Google Calculator API via cURL. (file_get_contents doesnt work in my hosting server).
the URL im trying to get data from is
http://www.google.com/ig/calculator?hl=en&q=1usd=?idr
the result of loading from a browser:
{lhs: "1 U.S. dollar",rhs: "8 928.57143 Indonesian rupiahs",error: "",icc: true}
but my script returns :
{lhs: "1 U.S. dollar",rhs: "8Â 928.57143 Indonesian rupiahs",error: "",icc: true}
as you can see on the rhs part there are white space differences, and a funny A character, hampering my rounding operations.
my script before exploding & rounding etc: ($url has been set to the above value)
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $this->url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)");
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 10);
$rawresult = curl_exec($ch);
curl_close($ch);
how do i get the same formatting?