<<< Previous question <<< Question ID#0338.md >>> Next question >>>
What is the output of the following PHP script?
$colors = ['r' => 'f00', 'g' => '0f0', 'b' => '00f'];
next($colors);
foreach ($colors as $k => $v) {
echo $k;
}
reset($colors);
while (list($v, $k) = each($colors)) {
echo $v;
}
- A) rgbrgb
- B) rgbgb
- C) rgbf000f000f
- D) gbrgb
Answer
Answer: A