Continue Control Structure:
Continue is another type of control structure which is used to re-initialize the iteration without finishing the current iteration, continue is used within looping structures (like for, foreach, while, do-while and switch case)to avoid rest of the code.
If we want to continue the higher levels of enclosing loops then we need to use continue with optional numeric argument.
Example:
<?php
$arr
=array(1,2,3,4,5);foreach
($arr as $val):if
($val==4)continue;echo
$val."<br/>";endforeach
;?>
Output:
1
2
3
5
Example:
<?php
$arr
=array(1,2,3,4,5,56,76);for
($key=0;$key<7;$key++){ if(!($key%2)) continue; elseecho
$arr[$key]."<br/>";}
Output:
2
4
56
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.