Yngvarr

Generation

generate functionSat, 07 Jan 2023

return xml gz archive

function getXmlGzArchive() { $xml = simplexml_load_file('https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml'); $xml = $xml->xpath('//Cube[@currency][@rate]'); $archive = []; foreach ($xml as $node) { $archive[(string)$node['time']][(string)$node['currency']] = (float)$node['rate']; } return $archive; }

Questions about programming?Chat with your personal AI assistant