PHP Code:


<?php
$i = 0;

echo "loop started at " . $i . "<br />";

while($i < 5) 
{	
	$i++;
	
	for($j = 1; $j <= 2; $j++) 
	{
		if($i == 2)	
		{
			echo "continue 1 used inside if statement when i = " . $i . " and j = $j<br />";
			continue 1; // at this point, the process is stopped here and will continue remaining iteration of for loop
		}
		else if($i == 4)
		{			
			echo "continue 2 used inside if statement when i = " . $i . " and j = $j. " .
			"This will continue the while loop process, " .
			"so both (i = $i, inside while loop) and " .
			"(inside for loop. i = $i and j = $j) will not be printed" .
			"<br />";
			continue 2;	// at this point, the process is stopped here and will continue remaining iteration of while loop
		}	

		echo "inside for loop. i = $i and j = $j <br />";
	}
	
	echo"i = $i, inside while loop <br />";
}
?>

Output: