Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getJPYtoUSDExchangeRate(){
- $from = 'JPY';
- $to = 'USD';
- $amount = 1;
- $data = file_get_contents("https://finance.google.com/finance/converter?a=$amount&from=$from&to=$to");
- preg_match("/(.*)/",$data, $converted);
- $converted = preg_replace("/[^0-9.]/", "", $converted[1][0]);
- return number_format(round($converted, 3),2);
- }
Add Comment
Please, Sign In to add comment