- file_get_contents: documentation ( source)
<?php
function ConverCurrency(){
$google_url = "http://rate-exchange.appspot.com/currency?from=USD&to=PKR";
$result = file_get_contents($google_url);
return $result;
}
echo $converted_value = ConverCurrency();
//output {"to": "PKR", "rate": 104.328, "from": "USD"}
?>