The continue Statement PHP

The continue statement is similar to the break statement except that instead of stopping the loop entirely, only the current execution of the loop is stopped. Control is returned to the closing curly brace and the loop continues. Inside for loops, described below, increments will occur just as if control had reached the end of the loop otherwise.

As you might imagine, this function is used to skip parts of a loop when a condition is met. demonstrates this idea. Random numbers are generated inside a loop until ten numbers, each greater than the previous, are produced. Most of the time the body of the loop is skipped due to the if statement that triggers a continue statement.

The continue Statement

The continue Statement

The continue Statement



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

PHP Topics