When using foreach, the values you work with inside the loop are copies of the values in the array itself. This means that if you change the value given to you by foreach, you're not affecting the corresponding value in the original array.
If you want to change selection, open document below and click on "Move attachment"
php 6his code produces the same list of keys and values as shown in Figure 6-3.
Altering Array Values with foreach
<span>When using foreach, the values you work with inside the loop are copies of the values in the array itself. This means that if you change the value given to you by foreach, you're not affecting the corresponding value in the original array. The following example code illustrates this:
$authors = array( "Steinbeck", "Kafka", "Tolkien", "Dickens" Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details