Looping through multidimensional array
<p>I have this array:</p>

<pre><code>$products = Array ( 

    [0] =&gt; Array ( 

        [keyseries_id] =&gt; 7 
        [product_id] =&gt; 1 
        [name] =&gt; Defender standaard sleutel 
        [price] =&gt; 6.25 
        [description] =&gt; Dit is een test voor de product descriptions 
        [image_id] =&gt; 1 
        [imageinfo] =&gt; Array ( 

                [filename] =&gt; Array ( 

                        [0] =&gt; defender_thumb.jpg 
                        [1] =&gt; defender_standaard.jpg ) 

                [imagedescription] =&gt; Array ( 

                        [0] =&gt; dit is een testafbeelding 
                        [1] =&gt; Dit is een 2e testafbeelding ) 

                    ) 

            ) 

    [1] =&gt; Array ( 

        [keyseries_id] =&gt; 7 
        [product_id] =&gt; 2 
        [name] =&gt; Defender Klapsleutel 
        [price] =&gt; 7.00 
        [description] =&gt; Dit is de defender klapsleutel.. NU IN DE AANBIEDING!!! 
        [image_id] =&gt; 3 
        [imageinfo] =&gt; Array ( 

                [filename] =&gt; Array ( 

                        [0] =&gt; defender_thumb.jpg 
                        [1] =&gt; defender_klap.jpg ) 

                [imagedescription] =&gt; Array ( 

                        [0] =&gt; Defender slot 
                        [1] =&gt; Defender klapsleutel ) 

                    ) 

            ) 

    )
</code></pre>

<p>I want to do a <code>foreach</code> loop for every <code>filename</code> and <code>imagedescription</code>, so I can use the <code>filename</code> and <code>imagedescription</code> for an <code>&lt;img&gt;</code> html tag in my application. Can somebody show me how to do this?</p>

<p>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</p>

<p>ANSWER: THANKS TO PHILIPP</p>

<p>Implemented the foreach loop like this:</p>

<pre><code>&lt;?php foreach($product['imageinfo']['filename'] as $index =&gt; $filename): ?&gt;

                        &lt;?php echo '&lt;img src="http://localhost/sleutelservice/uploads/images/' . $filename . '" alt="' . $product['imageinfo']['imagedescription'][$index].  '"&gt;';  ?&gt;

                    &lt;?php endforeach; ?&gt;
</code></pre>
