source);}
function getRate(){
$xmlData = NULL;
$p = xml_parser_create();
xml_parse_into_struct($p,$this->getXML() , $xmlData);
xml_parser_free($p);
$this->mydate = $xmlData[‘1’][‘value’];
$data = array();
if($xmlData){
foreach($xmlData as $v)
if(isset($v[‘attributes’]))
{$data[] = $v[‘attributes’];}
return $data;
}
return false;
}
function show(){$data = $this->getRate();
print ‘

‘;
print ‘

‘;
print ‘

‘;
foreach($data as $k=>$v)
if(strpos(‘#USD#EUR#JPY#’, $v[‘CURRENCYCODE’].’#’)>0)
{print ‘

‘;}
print ‘

Vietcombank cập nhật: ‘.$this->mydate.’
Mua Ch.khoản Bán
‘.$v[‘CURRENCYCODE’].’ ‘.$v[‘BUY’].’ ‘.$v[‘TRANSFER’].’ ‘.$v[‘SELL’].’

‘;}}
$rate = new Rate();
$rate->source = ‘http://www.vietcombank.com.vn/ExchangeRates/ExrateXML.aspx’;
$rate->show();
?>