Beginner PHP
Q34 / 100

Which function sorts an array in ascending order?

Correct! Well done.

Incorrect.

The correct answer is C) sort($arr)

C

Correct Answer

sort($arr)

Explanation

sort() sorts by value and re-indexes keys. asort() preserves keys. ksort() sorts by key. rsort() sorts in descending order.

Progress
34/100