title: PHP foreach with exif_read_data keep saying Warning: Invalid argument supplied for foreach()
body: <p>i tried several variant of getting exif info written out. but in every case i had similar problem: </p>
  
  <blockquote>
    <p>"Warning: Invalid argument supplied for foreach()" --
    in: foreach ($section as $name => $val)</p>
  </blockquote>
  
  <pre><code>$exif = @exif_read_data($result['path'], 'IFD0');
  
   if(is_array($exif))
    foreach ($exif as $key =&gt; $section) {
     foreach ($section as $name =&gt; $val) {
       echo "$key.$name: $val&lt;br /&gt;\n";
     } 
   }
  </code></pre>