update: added additional note fields (#29551)
* fix: corrected placement of notes Some "note" fields were preemptive in their placement; I corrected their placement to be in more appropriate locations. * update: added additional note fields Added some additional "note" fields to assist those who are reading through the PHP documentation. * fix: formatting of escape sequence examples The formatting was a bit jumbled, so I cleaned up the formatting of the escape sequence. * update: improved examples I added a new example to demonstrate the use of a "break" statement in a while loop, as well as numbered each example. * update: add clarifying statement I added a note at the end of the description, with the goal of being a bit more explicit in terms of what the "continue" statement does.
This commit is contained in:
committed by
Randell Dawson
parent
e545aceab8
commit
723fa03609
@ -8,6 +8,7 @@ The `continue` statement passes control to the next iteration inside a loop.
|
||||
|
||||
In this example, when the value of i is 2, the next statement within the loop is skipped.
|
||||
|
||||
Note: When you execute a `continue` statement, you're effectively bypassing whatever code comes after it (in terms of execution) within the loop. This, along with the `break` statement, are very useful when working with loops.
|
||||
## Example
|
||||
```
|
||||
int[] array = { 1, 2, 3, 4, 5 };
|
||||
@ -17,7 +18,7 @@ for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
Console.WriteLine("Item on index {0} is {1}", i, array[i]);
|
||||
Console.WriteLine("Item on index {0} is {1}", i, array[i]);
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user