PHP - Statement continue Statement


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:



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