Is it posible to do a loop, and inside the loop do tests, if the test succeed, break out of the loop?
eg.
foreach($foo as $foo) { if ($this == 1) { //break out of loop } else { //continue testing } }
yes, with break or exit depending on what you want to stop actually.
read more about it in the php.net manual.