Home >> Snippet List >> Snippet

Name
Basic currency conversion Convert 1 dollar to pounds using Yahoos conversion
Description
Convert 1 dollar to pounds using Yahoo's conversion
PHP Snippet
<?PHP 
 
$convert = FILE('http://quote.yahoo.com/m5?a=1&t=GBP&s=USD'); 
$convert = JOIN("",$convert); 
$convert = EREG_REPLACE(".*<table border=1 cellpadding=2 cellspacing=0>",'',$convert); 
$convert = EREG_REPLACE("</table>.*",'',$convert); 
$convert = EREG_REPLACE("</b>.*",'',$convert); 
$convert = EREG_REPLACE(".*<b>",'',$convert); 
ECHO "1 US Dollar = $convert British Pounds"; 
 
?>