Drive PHP with break and continue
http://www.techmug.com/drive-php-with-break-and-continue/ This article demonstrates the concept of break and continue. break saves your loop from more iteration and continue helps to boost your logic.