foreach()
Thanks to:
No one :(
Description
Indeed, a for loop!
Usage: foreach($array as $value) CC// In case of a dictionary style variable, you can pass the key and its valueCC foreach($dict as $key => $value) CC// Even if the iterable object is not a dict, you can still use same structure to get the index and the valueCC $data = [ 1, 2, 3, 4, 5 ]; foreach ($data as $index => $value) { echo $index . "\n"; } CC// If the value of the iterable object needs to be changed, you can reference it via. a pointerCC foreach($data as &$value) { echo ++$value . "\n"; } unset($value); CC// Remember to unset the reference, otherwise it can still be used to change the object of the latest value from the old object set CC