- file_get_contents: documentation ( source)
- round: documentation ( source)
- explode: documentation ( source)
- preg_replace: documentation ( source)
<?php
$get = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from&to=$to");
$get = explode("<span class=bld>",$get);
$get = explode("</span>",$get[1]);
$converted_amount = preg_replace("/[^0-9\.]/", null, $get[0]);
return round($converted_amount);