Zend
200-530 · Question #442
You have been given a code snippet as follows: $somearray = array("hi", "this is a string", "this is a code"); You want to iterate this array and modify the value of each of its elements. Which of…
The correct answer is D. For loop. See the full explanation below for the reasoning.
Question
You have been given a code snippet as follows: $somearray = array("hi", "this is a string", "this is a code"); You want to iterate this array and modify the value of each of its elements. Which of the following ways will you use to accomplish the task?
Options
- AWhile loop
- BDo while loop
- CFor each loop
- DFor loop
How the community answered
(62 responses)- A11% (7)
- B3% (2)
- C5% (3)
- D81% (50)
Community Discussion
No community discussion yet for this question.