1.

Which of the functions is used to sort an array in descending order?(a) sort()(b) asort()(c) rsort()(d) dsort()The question was asked in an online quiz.I want to ask this question from Arrays in section Arrays and Functions of PHP

Answer»

The CORRECT answer is (C) rsort()

To explain: The function sort() will sort thearrays in ascending order, the function rsort() will sort ARRAYS in DESCENDING order. While the function asort() will sort associative arrays in ascending order, ACCORDING to the value.



Discussion

No Comment Found

Related InterviewSolutions