Hi all,
Here is what I am trying to do:
$count = 0;
while ($count < 5) {
foreach (list as item) {
do stuff
if (condition from do stuff true) {
$count++;
} //end if
}//end foreach
} //end while
If the condition is true (in if statement) I want it to stop after 5 iterations.
Problem: the count is not "seen" by the while loop and I only want to increment the counter if a condition has been met.
Does anybody have any suggestions on how to code this?
Your help is greatly appreciated