PHP while continue statement
by tutorialsw3.com - May 23, 2019
PHP continue statement
Definition and UsagePHP “continue” statement is used within the loops to skip the current loop iteration and goes to the next iteration.
See the syntax structure of “continue statement”
<?php
while ( expression 1)
{
if ( expression 2 )
{
continue ;
}
// Operation Statements
}
?>
Example of PHP continue statement
In this structure if expression 2 return TRUE , continue statement will execute and it will skip that iteration and wont execute the rest portions of code after the “continue” command, control will go to the next iteration in while loop with expression 1.See the sample PHP program with “continue” statement
<?php
$a = 0;
while ( $a < 3)
{
$a++;
$b = 0;
while ( $b < 5)
{
$b++;
if ($b==3)
{
continue;
}
echo $a*$b." ";
}
echo "
"; }
?>
Output of this program will be
1 2 4 5
2 4 8 10
3 6 12 15
Example of PHP while statement
See the following continue syntax structure
while ( expression 1)
{
while ( expression 2 )
{
if ( expression 3 )
{
continue 2;
}
// Operation Statements
}
}
In this structure , if expression 3 becomes TRUE , continue statement will execute with parameter 2. So it will skip the current iteration in while loop with expression 2 also with current iteration with first while loop with expression 1. Next iteration will start from the first while loop.
Read more on: PHP Tutorial » For do while foreach break continue in phpphp while continue next, not working, break, loop break and continue, php while if continue
php while continue next, not working, break, loop break and continue, php while if continue

The site is addressed to people who want to get started in web programming. Careful! PHP means programming. It is true that a web developer must have a minimum knowledge of web design (HTML, CSS, JavaScript and others), but this site only deals with programming issues.
css | Css rounded corners |
html | Html input size |
css | Css background image opacity |
css | Css background image size to fit screen |
php-mysqli | Mysqli_fetch_array |
html | Html div style class tutorial |
- Paphos, Larnaca, Limassol, Nicosia. Ce-i de vizitat
- Paphos, Larnaca, Limassol, Nicosia. Ce-i de vizitat
- Paphos, Larnaca, Limassol, Nicosia. Ce-i de vizitat
- Paphos, Larnaca, Limassol, Nicosia. Ce-i de vizitat