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?
$classes = array('red', 'blue', 'yellow', 'green', 'black', 'purple', 'grey');
foreach($classes as $class){
foreach ($html->find('.yfnc_datamodoutline1 .yfnc_tabledata1') as $element){
$symbols = $element->outertext;
echo '<div class="'.$class.'">'.$symbols.'</div>';
}
it outputs this
<div class="red">Jul 6, 2012</div>
<div class="red">12,889.40</div>
<div class="red">12,889.40</div>
<div class="red">12,702.99</div>
<div class="red">12,772.47</div>
<div class="red">967,600</div>
<div class="red">12,772.47</div>
Im trying to make it output this
<div class="red">Jul 6, 2012</div>
<div class="blue">12,889.40</div>
<div class="yellow">12,889.40</div>
<div class="green">12,702.99</div>
<div class="black">12,772.47</div>
<div class="purple">967,600</div>
<div class="grey">12,772.47</div>