O problema de care se loveste oricine, cei care presteaza cod , pagini web, un simplu
script iti poate usura munca. Nu demult BNR (de prin 2007) a venit in sprijinul programatorilor punand la dispozitie cursul valutar intr-un fisier de tip xml din care se poate citi orice curs ai nevoie.
Iata un exemplu pentru cursul EUR, USD, LIRA STERLINA si GRAMUL DE AUR :
——————————————-

<?php
$objDOM = new DOMDocument();
$objDOM->load("http://www.bnro.ro/nbrfxrates.xml");
$cursuri = $objDOM->getElementsByTagName("Rate");
$data=$objDOM->getElementsByTagName("SendingDate")->item(0)->nodeValue;
list($year, $month, $day) = split('[-.-]', $data);
$data=$day.'.'.$month.'.'.$year;

$eur=$cursuri->item(10)->nodeValue;
$usd=$cursuri->item(26)->nodeValue;
$gbp=$cursuri->item(11)->nodeValue;
$xau=$cursuri->item(27)->nodeValue;
$chf=$cursuri->item(5)->nodeValue;
$pln=$cursuri->item(20)->nodeValue;
?>
<table width="159" border="0" cellpadding="0" cellspacing="3">
<tr>
<td width="34"><img src="http://www.bnr.ro/img/valute/eur.gif" title="Curs EURO" alt="Curs EURO"/></td>
<td width="42">EUR</td>
<td align="right"><?php echo $eur;?></td>
</tr>
<tr>
<td><img src="http://www.bnr.ro/img/valute/usd.gif" title="Curs Dolar" alt="Curs Dolar"/></td>
<td align="left">USD</td>
<td align="right"><?php echo $usd;?></td>
</tr>
<tr>
<td align="left"><img src="http://www.bnr.ro/img/valute/gbp.gif" alt="Lira Sterlina" title="Lira Sterlina"/></td>
<td align="left">GBP</td>
<td align="right"><?php echo $gbp;?></td>
</tr>
<tr>
<td align="left"><img src="http://www.bnr.ro/img/valute/xau.gif" alt="Gram aur" title="Gram aur"/></td>
<td align="left">XAU</td>
<td align="right"><?php echo $xau;?></td>
</tr>
<tr>
<td align="left"><img src="http://www.bnr.ro/img/valute/chf.gif" alt="Franc Elvetian" title="Franc Elvetian"/></td>
<td align="left">CHF</td>
<td align="right"><?php echo $chf;?></td>
</tr>
<tr>
<td align="left"><img src="http://www.bnr.ro/img/valute/pln.gif" alt="Zlotul polonez" title="Zlotul polonez"/></td>
<td align="left">PLN</td>
<td align="right"><?php echo $pln;?></td>
</tr>
<tr>
<td colspan="3" align="right"><hr /></td>
</tr>
<tr>
<td colspan="3" align="right">valabil la : <?php  echo $data;?></td>
</tr>
</table>

——————————————-

Atentie. pt folosirea lui in CMS-uri gen WORDPRESS, JOOMLA etc, este necesara insalarea unor pluginuri pt. recunoasterea de cod php. Printr-un simplu google search se pot gasi foarte usor.