I have the following snip of code in one of my applications:
begin snip
// getAllPost returns a key=>value array
$post = getAllPost($authorId);
foreach($post as $key => $value) {
// display HTML
} // end foreach
end snip
When I run this foreach construct within an if ... else control structure, it only gives me the first key=>value pair. When I run a stripped-down version of the same code (using print_r), this code runs flawlessly. Has anyone had problems with foreach within another control construct?