This statement specifies to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.

Syntax: continue [n]

Description:

The argument “n” is Optional.It specifies the Number of levels to skip.
Example:
Code:


for  ($i = 0; $i < 10; $i++) {
   if ($i== 5)
      continue;
   echo "$i ";
}

Output:

0 1 2 3 4 6 7 8 9

eXTReMe Tracker