My foreach loop is skipping an element?
How is this possible?
echo '<p>-- Begining of Vardump --</p>
';
var_dump($EventTotals);
echo '
<p>-- End of Vardump --</p>
<p>-- Begining of Just echo --</p>
<p>'.$EventTotals[1]['TITLE'].'</p>
<p>'.$EventTotals[2]['TITLE'].'</p>
<p>-- End of Just echo --</p>
<p>-- Begining of Foreach --</p>
';
foreach ($EventTotals as $DATA);
{
echo '<p>'.$DATA['TITLE']."</p>\n";
}
echo '<p>-- End of Foreach --</p>
';
Gives me this output:
<p>-- Begining of Vardump --</p>
array(2) {
[2]=>
array(3) {
["TITLE"]=>
string(9) "Book Sale"
["TARGETHOURS"]=>
string(4) "0.00"
["HOURS"]=>
float(4)
}
[1]=>
array(3) {
["TITLE"]=>
string(15) "Spring Jogathon"
["TARGETHOURS"]=>
string(5) "10.00"
["HOURS"]=>
float(7)
}
}
<p>-- End of Vardump --</p>
<p>-- Begining of Just echo --</p>
<p>Spring Jogathon</p>
<p>Book Sale</p>
<p>-- End of Just echo --</p>
<p>-- Begining of Foreach --</p>
<p>Spring Jogathon</p>
<p>-- End of Foreach --</p>
Why does the foreach skip one of the elements of the array? Bug or am I missing something obvious?