How to break out of a foreach once a condition is met?
PHP Snippet 1:
if ($small_object->TIME == $sought_time) {
break;
}
PHP Snippet 2:
$count = 0;
......
..
..
..
..
......
if (++$count == 5) break;
if ($small_object->TIME == $sought_time) {
break;
}
$count = 0;
......
..
..
..
..
......
if (++$count == 5) break;