1<?php
2for($i=0;$i<10;$i++)
3{
4 if($i==3)
5 {
6 continue; //it will break one iteration.
7 }
8 echo $i;
9}
10?>
1$basket = ['apples', 'bananas', 'broccoli', 'peaches', 'pears'];
2
3foreach ($basket as $fruit) {
4 if ($fruit === 'broccoli') {
5 continue; // Skips 'broccoli' and moves onto 'peaches'
6 }
7
8 echo sprintf('I love %s!', $fruit);
9}
10
11// I love apples!
12// I love bananas!
13// I love peaches!
14// I love pears!