Hi,
an die PHP-Freaks hier :-)
Wie kann ich beiliegender PHP-Datei klarmachen, dass sie die Werte aus rate[1] und currencycode[1] in eine neue Datei schreibt (csv, semikolon getrennt)?
<?php
$XMLContent= file("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml");
foreach ($XMLContent as $line) {
if (ereg("currency='([[:alpha:]]+)'",$line,$currencyCode)) {
if (ereg("rate='([[:graph:]]+)'",$line,$rate)) {
//Output the value of 1 EUR for a currency code
echo '1 € = '.$rate[1].' '.$currencyCode[1].'<br />';
//--------------------------------------------------
// Here you can add your code for inserting
// $rate[1] and $currencyCode[1] into your database
//--------------------------------------------------
}
}
}
?>
Mercie! :-)
Hoi :)
gugg mal da:
http://de2.php.net/manual/de/function.file-put-contents.php