Which of the following PHP functions is used to sort an array in ascending order without
Which of the following PHP functions is used to sort an array in ascending order without
affecting the keys?
Show answerHide answer
Correct answer: (C) asort()
Explanation
asort() sorts an array by value in ascending order while keeping each key associated with its value. sort() re-indexes the keys, and ksort() sorts by key.