This may be simple to some of you guys but im a novice coder. How do i make this foreach loop terminate after i loops. The number keeps resetting as it loops through another condition. There are multiple a's. About 100 so it i never gets up to 250.
$i = 0;
foreach ($a as $b) {
//do function
i++;
if (i == 250)
{
exit;
}
}