For example in a for loop you can kick out like this:
for($i = 0; $i < count($ary); $i++){
if($ary[$i] == 'blah')
$i = count($ary);
echo $i;
}
Or in a while loop:
$i = 0;
while($i < count($ary)){
if($ary[$i++] == 'blah')
$i = count($ary);
echo $i;
}
Not sure really what you mean by “kick out”, but:
To skip to the next item, use
continue;To stop the entire loop, use
break;