nested foreach loop, 1st loop not looping
<p>Im trying to get my array to loop in the foreach loop but it keeps looping the same one over and over. What am I doing wrong?</p>

<pre><code>$classes = array('red', 'blue', 'yellow', 'green', 'black', 'purple', 'grey');
foreach($classes as $class){
foreach ($html-&gt;find('.yfnc_datamodoutline1 .yfnc_tabledata1') as $element){
    $symbols = $element-&gt;outertext;
    echo '&lt;div class="'.$class.'"&gt;'.$symbols.'&lt;/div&gt;';
}
</code></pre>

<p>it outputs this</p>

<pre><code>&lt;div class="red"&gt;Jul 6, 2012&lt;/div&gt;
&lt;div class="red"&gt;12,889.40&lt;/div&gt;
&lt;div class="red"&gt;12,889.40&lt;/div&gt;
&lt;div class="red"&gt;12,702.99&lt;/div&gt;
&lt;div class="red"&gt;12,772.47&lt;/div&gt;
&lt;div class="red"&gt;967,600&lt;/div&gt;
&lt;div class="red"&gt;12,772.47&lt;/div&gt;
</code></pre>

<p>Im trying to make it output this</p>

<pre><code>&lt;div class="red"&gt;Jul 6, 2012&lt;/div&gt;
&lt;div class="blue"&gt;12,889.40&lt;/div&gt;
&lt;div class="yellow"&gt;12,889.40&lt;/div&gt;
&lt;div class="green"&gt;12,702.99&lt;/div&gt;
&lt;div class="black"&gt;12,772.47&lt;/div&gt;
&lt;div class="purple"&gt;967,600&lt;/div&gt;
&lt;div class="grey"&gt;12,772.47&lt;/div&gt;
</code></pre>
