<<< Previous question <<< Question ID#0795.md >>> Next question >>>
What is displayed when the following code is executed?
$array = array(1, 2, 3, 4, 5);
foreach ($array as $i => $value) {
unset($array[$i]);
}
$array[] = 6;
print_r($array);
- A)
Array( [5] => 6)
- B)
Array()
- C)
Array([0] => 6)
- D)
Array( [6] => 6)
Answer
Answer: A