Why am I getting Illegal offset type error while trying to build an array?
function tassi_parser() {
$xml=simplexml_load_file('http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml');
foreach($xml->Cube->Cube->Cube as $tmp) {
$results[$tmp['currency']] = $tmp['rate'];
};
return $results;
};
$tmp['currency'] correctly contains a string that should be used as key so i can't understand what is the problem...