Magento Engineer
social
Journal

Difference between break and continue in PHP?

Break ends a loop completely and continue just shortcuts of a current iteration and moves on to the next iteration.

while ($condition) {   <--------------------+
    continue;          --- goes back here --+
    break;             ----- jumps here ----+
}                                     |
                       <--------------------+

Ad comes here
Comments
Leave A Comment
PHP blog
Update Cookies Preferences