PHP continue
In this chapter you will learn:
Description
continue causes PHP to skip the rest of the current loop iteration and go on to the next iteration.
Example
The following code uses the continue statement to start the next iteration.
<?php// j a v a2 s .com
for ($i = 1; $i < 10; $i = $i + 1) {
if ($i == 3) continue;
if ($i == 7) break;
print "Number $i\n";
}
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter: