Zend
200-530 · Question #428
You run the following code: <?php $array = array("a1"=>x,"a2"=>e,"a3"=>z); ksort( $array ); foreach ( $array as $keys => $values ) { print "$keys = $values "; } ?> What will be the output?
The correct answer is D. a1 = x a2 = e a3 = z. See the full explanation below for the reasoning.
Question
You run the following code: <?php $array = array("a1"=>x,"a2"=>e,"a3"=>z); ksort( $array ); foreach ( $array as $keys => $values ) { print "$keys = $values "; } ?> What will be the output?
Options
- A0 = e 1 = x 2 = z
- Ba1 = e a2 = x a3 = z
- CThe script will throw an error message.
- Da1 = x a2 = e a3 = z
How the community answered
(23 responses)- A4% (1)
- B17% (4)
- C9% (2)
- D70% (16)
Community Discussion
No community discussion yet for this question.