Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Which function should we use to sort the array in natural order?

a) dsort()
b) casesort()
c) natcasesort()
d) naturalsort()

Answer: c
Explanation: The function natcasesort() in PHP sorts an array by using a “natural order” algorithm. All the values keep their original keys. Eg: In a natural algorithm, as the number 2 is less than the number 10. But in computer sorting, 10 is less than 2, because the first number in “10” is less than 2. The function is case-insensitive.

Join The Discussion