The following examples illustrate
Break is used to jump out of the current execution loop and no longer executes the loop.
Copy the Code code as follows:
$i = 0;
while ($i < 7) {
if ($arr [$i] = = "Stop") {
Break
}
$i + +;
}
?>
Continue immediately stops the current execution loop and returns to the loop's conditional judgment, continuing the next loop.
Copy the Code code as follows:
while (list ($key, $value) = each ($arr)) {
if ($key = = "Zhoz") {//If the value of the queried object is equal to Zhoz, the record will not be displayed.
Continue
}
Do_something ($value);
}
Example 2
foreach ($list as $temp) {
if ($temp->value = = "Zhoz") {
Continue If the value of the query to an object equals Zhoz, the record is not displayed.
}
Do_list; This shows the records in the array
}
?>
Note that the goto loop instruction is not available in PHP.
The above describes the continue statement PHP break and continue two process control instructions, including the content of the continue statement, I hope that the PHP tutorial interested in a friend helpful.