PHP - Continue

Continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.

Example


<?php

	$i = 10;
	while (--$i)
	{
		if ($i==8)
		{
			continue;
		}
		if ($i==5)
		{
			break;
		}
		echo $i."\n";
	}

?>									
							

Output

9	
7	
6				
							
Share Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit