Vidyalelo
PHP · Q37

Arrays

Programming · PHP · question 37

Q37

What will be the output of the following PHP code?

A.
Array ( [1] => apple [0] => mango [2] => peach [3] => pear )
Answer
B.
Array ( [0] => apple [1] => mango [2] => peach [3] => pear )
C.
Error
D.
Array ( [1] => apple [0] => mango [3] => peach [2] => pear )

Answer: Option A

Solution

Answer: Option A
Solution:
The function asort() sorts the array in ascending order, except that the key/value corresponding is maintained.