title: PHP XML: Illegal Offset, but it is in array?
body: <pre><code>$dagen = array(
      'Mon' =&gt; 'Maandag',
      'Tue' =&gt; 'Dinsdag',
      'Wed' =&gt; 'Woensdag',
      'Thu' =&gt; 'Donderdag',
      'Fri' =&gt; 'Vrijdag',
      'Sat' =&gt; 'Zaterdag',
      'Sun' =&gt; 'Zondag'
  );
  
  foreach ($xml-&gt;verwachtingen-&gt;verwachting as $verwachting) {
      $graden = $verwachting-&gt;maxtempGRC - $verwachting-&gt;mintempGRC;
      $graden = $graden / 2;
      $graden = $graden + $verwachting-&gt;mintempGRC;
      $dag = $verwachting-&gt;dagvdweek;
  
      echo 'Op '. $dagen[$dag] .' wordt het '. $graden .' graden';
  }
  </code></pre>
  
  <p>$xml is the XML document loaded using SimpleXMLElement.</p>
  
  <p>Now, help me out here. When i echo <code>$dag</code> 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:</p>
  
  <pre>
  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
  ...
  </pre>
  
  <p>Does someone know why i get this error? Thanks.</p>