$dagen = array(
'Mon' => 'Maandag',
'Tue' => 'Dinsdag',
'Wed' => 'Woensdag',
'Thu' => 'Donderdag',
'Fri' => 'Vrijdag',
'Sat' => 'Zaterdag',
'Sun' => 'Zondag'
);
foreach ($xml->verwachtingen->verwachting as $verwachting) {
$graden = $verwachting->maxtempGRC - $verwachting->mintempGRC;
$graden = $graden / 2;
$graden = $graden + $verwachting->mintempGRC;
$dag = $verwachting->dagvdweek;
echo 'Op '. $dagen[$dag] .' wordt het '. $graden .' graden';
}
$xml is the XML document loaded using SimpleXMLElement.
Now, help me out here. When i echo $dag
it displays 'Fri' because it is Friday. So i try to convert the english words of the days to my language (dutch). But it doesn't seem to work, because i get this:
Warning: Illegal offset type in C:\data\home\www\awnl-xml\index.php on line 21 Op wordt het 18.5 graden Warning: Illegal offset type in C:\data\home\www\awnl-xml\index.php on line 21 Op wordt het 18 graden Warning: Illegal offset type in C:\data\home\www\awnl-xml\index.php on line 21 ...
Does someone know why i get this error? Thanks.