Hey, I am doing alot of work and end up having alot of issues to over come. And Now I Need help once again.
I Have This Code Here:
<?php
$url = "http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml";
$contents = file($url);
$currencies = Array();
for($i=1; $i<=count($contents); $i++){
if(stristr($contents[$i], "currency=") !== FALSE){
$currency = substr($contents[$i], 17, 19);
list ($first, $type, $ext) = explode ('=', $currency);
$currency = substr($type, 1,4);
$amount = substr($contents[$i], 28, 32);
$currencies[$currency] = $amount;
}
}
foreach($currencies as $curr => $amnt){
$end = strlen($amnt);
$ammount = substr($amnt, 2, $end-4);
echo "Currency: <b>".$curr."</b> Amount: <b>".$ammount."</b><br>";
}
?>
And I Get This Output
http://www.xmgscripts.com/cart/xmltest.php
What I Need To Do Is Create a few functions to convert between an admin defined currency, to the users selected currency.
Then Once I Have That, i need to return a new array with the conversion rates between the two currencies.
If Someone can help with this, it would be appreciated.
Regards
~Lance