Currency Exchange Script Toss
All it does is connect to google currency converter and grabs the static data I'm looking for. To change which currency to exchange and the amount you can change the options at the top. I didn't need it for all currencies so I made it this way. I could make drop down menus if anyone would be interested. Peace
<?PHP $amount = 1; $from = USD; $to = MXN; $time = stream_context_create(array( 'http' => array('timeout' => 1))); $hold = file_get_contents("http://www.google.com/finance/converter?a=$amount&from=$from&to=$to", 0, $time); $res = preg_match("/<span class=bld>(.*)<\/span>/",$hold,$match); $result = $match[1]; $final = preg_replace('#\D*?(\d+(\.\d+)?)\D*#','$1',$result); echo "<center><font size='+1'>Current Exchange: Mexico</font><br> $amount $from = <b> $final pesos</b></center>"; ?>