Zend
200-530 · Question #396
Consider the following code: <?php $array = array("a1"=>x,"a2"=>e,"a3"=>z); asort( $array ); foreach ( $array as $keys => $values ) { print "$keys = $values "; } ?> What will be the output?
The correct answer is C. a2 = e a1 = x a3 = z. See the full explanation below for the reasoning.
Question
Consider the following code: <?php $array = array("a1"=>x,"a2"=>e,"a3"=>z); asort( $array ); foreach ( $array as $keys => $values ) { print "$keys = $values "; } ?> What will be the output?
Exhibit
Options
- Aa1 = e a2 = x a3 = z
- BThe script will throw an error message.
- Ca2 = e a1 = x a3 = z
- D0 = e 1 =x 2 = z
How the community answered
(62 responses)- A3% (2)
- B6% (4)
- C77% (48)
- D13% (8)
Community Discussion
No community discussion yet for this question.
