PHP - Statement continue Statement

Introduction

continue statement prematurely ends the current iteration of a loop and move onto the next iteration.

You can use it to skip the current item of data.

The following example counts from 1 to 10, but it misses out the number 4:

Demo

<?php

         for ( $i=1; $i  <= 10; $i++ ) {
            if ( $i == 4 ) continue;
            echo "I've counted to: $i \n ";
         }//  w ww.  j  av  a  2  s .  c  o m
         echo "All done!";
?>

Result